This issue has been migrated from Redmine: https://dev.icinga.com/issues/13036
Created by donsch on 2016-11-03 12:46:38 +00:00
Assignee: _(none)_
Status: _New_
Target Version: _(none)_
Last Update: _2017-01-09 16:53:47 +00:00 (in Redmine)_
Icinga Version: 2.5.4-1
I reported this yesterday and it was rejected. So I built a fresh clean Ubuntu server, and installed only Icinga2 core functionality. And reinstalled the windows agent on a Windows Server 2012 R2 machine. All went well and working as expected. HOWEVER, as soon as the windows agent service is stopped for any reason, IT WILL NOT START AGAIN. All default configs, everything is WORKING! until a windows client is rebooted.
It throws a box saying "The Icinga 2 service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs."
Attachments
Updated by donsch on 2016-11-08 20:46:51 +00:00
I put this in the wrong section, it is Icinga2 issue. I have some new info. If I install the Windows client FIRST, I can restart the service as many times as I want without problems. However, as soon as the host is added via director, that is the point where the Windows service will not start anymore. There is something in director that upsets the Windows agent service.
Noteworthy is that if the Windows service is not restarted, everything works and reports as expected. All director configs continue to deploy without issue.
Updated by donsch on 2016-11-09 13:37:52 +00:00
I have one last thing to add. If the windows agent service is installed with "Accepts Config from Master?" UNCHECKED, then all seems to work as expected. Director apparently sends a corrupted or incompatible config back to the client if it is allowed to.
Updated by mfriedrich on 2017-01-09 16:53:47 +00:00
Found a work around just delete the config in: C:\ProgramData\icinga2\var\lib\icinga2\api\zones and start the service
@monster400 Does this still occur with the v.2.7.0 release?
I tried to reproduce this but I couldn't. One thing that come to my mind while testing was that you not disabled the inclusion of the conf.d directory on the windows host? That would explain why it worked when you unchecked the Accept Config from Master CheckBox.
Hello
i dont have a conf.d folder on my winhost, i use Director for my config, but when i installed the agent i said it should pull config
C:\ProgramData\icinga2\var\lib\icinga2\api\zones\dc01.scholdan.net\director
@monster400 Could you posts the logs from your dc01.scholdan.net zone?
We've seen similar behavior with the same solution. In our situation we have a master node with two satellite's with Icinga 2.6.1. If we used director to deploy changes and there was an error in one of the satellite's configs, director would say the deployment was a success and two of the three zones would work. We would solve it by deleting the configs in that zone and the restarting the service after we fixed the error's director.
I will try to find the log file tomorrow, I'm a little new to linux and icinga, but I will try to find it, but i think my DC is a endpoint. right now I'm just using a bat file to delete the folder and start the service:)
Hello
I found were i saw the error:
Running command 'icinga2.exe daemon --validate' produced the following output:
information/cli: Icinga application loader (version: v2.7.0)
information/cli: Loading configuration file(s).
critical/config: Error: Object 'dc01.scholdan.net' of type 'Host' re-defined: in C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf: 1:0-1:30; previous definition: in C:\ProgramData\icinga2\etc\icinga2/conf.d/hosts.conf: 18:1-18:20
Location: in C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf: 1:0-1:30
C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf(1): object Host "dc01.scholdan.net" {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf(2): import "Windows"
C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf(3):
Host file
object Host "dc01.scholdan.net" {
import "Windows"
display_name = "dc01.scholdan.net"
address = "10.0.0.10"
notes = "gui"
groups = [ "scholdan" ]
vars.load_win_crit = "90"
vars.load_win_warn = "80"
}
Serviceset file
/* Service Set 'GUI' */
object Service "Check_RDP" {
host_name = "dc01.scholdan.net"
import "Check_RDP"
import DirectorOverrideTemplate
}
had to change them to txt
@monster400 The error comes from C:\ProgramData\icinga2\var\lib\icinga2\api\zones/dc01.scholdan.net/director/hosts.conf: 1:0-1:30; previous definition: in C:\ProgramData\icinga2\etc\icinga2/conf.d/hosts.conf:
Check your icinga2.conf, which I'm guessing is at C:\ProgramData\icinga2\etc\icinga2\icinga2.conf , near the bottom for include_recursive "conf.d". If it's there try changing it to #include_recursive "conf.d" and restart the service.
@cflinspach
Still the same,
C:\ProgramData\icinga2\etc\icinga2/conf.d/hosts.conf:
/*
icinga2 object list --type Host toicinga2 daemon -C)./*
constants.conf or use yourobject Host NodeName {
/* Import the default host template defined in templates.conf. */
import "generic-host"
/* Specify the address attributes for checks e.g. ssh or http. */
address = "127.0.0.1"
address6 = "::1"
/* Set custom attribute os for hostgroup assignment in groups.conf. */
vars.os = "Windows"
/* Define disks and attributes for service apply rules in services.conf. /
vars.disks["disk"] = {
/ No parameters. */
}
vars.disks["disk C:"] = {
disk_win_path = "C:"
}
/* Define notification mail attributes for notification apply rules in notifications.conf. /
vars.notification["mail"] = {
/ The UserGroup icingaadmins is defined in users.conf. */
groups = [ "icingaadmins" ]
}
}
@monster400
i dont have a conf.d folder on my winhost, i use Director for my config, but when i installed the agent i said it should pull config
You have a conf.d folder on your windows host. If you use the director for configuring Icinga 2 you need to disable the inclusion localy on the windows host. If you not do it there will always be multiple objects and the Icinga 2 service fails.
Simply comment out the line include_recursive "conf.d" in C:\ProgramData\icinga2\etc\icinga2\icinga2.conf (on the windows host). That should fix the problem.
When you have still problems after that, this could be an another issue. Please re-run the command icinga2.exe daemon --validate on the windows host, to see where the Icinga 2 service fails.
I'm not sure about the real problem, but reloads will be tackled with 2.9. If the problem arises with that version again, please create a new issue with all the details.