Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #13036] Windows agents fails to restart #4763

Closed
icinga-migration opened this issue Nov 3, 2016 · 14 comments
Closed

[dev.icinga.com #13036] Windows agents fails to restart #4763

icinga-migration opened this issue Nov 3, 2016 · 14 comments
Labels
area/windows Windows agent and plugins bug Something isn't working

Comments

@icinga-migration
Copy link

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

@icinga-migration
Copy link
Author

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.

@icinga-migration
Copy link
Author

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.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2017-01-09 16:53:47 +00:00

  • Project changed from Web to Icinga 2
  • Category deleted 42

@icinga-migration icinga-migration added the bug Something isn't working label Jan 17, 2017
@dnsmichi dnsmichi added the help wanted Extra attention is needed label Apr 26, 2017
@scholdan
Copy link

scholdan commented May 16, 2017

Found a work around just delete the config in: C:\ProgramData\icinga2\var\lib\icinga2\api\zones and start the service

@mcktr
Copy link
Member

mcktr commented Aug 14, 2017

@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.

@scholdan
Copy link

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

@cflinspach
Copy link

@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.

@scholdan
Copy link

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:)

@scholdan
Copy link

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):

@scholdan
Copy link

scholdan commented Aug 14, 2017

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

Hosts.txt
servicesets.txt

@cflinspach
Copy link

@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.

@scholdan
Copy link

@cflinspach

Still the same,

C:\ProgramData\icinga2\etc\icinga2/conf.d/hosts.conf:
/*

  • Host definitions with object attributes
  • used for apply rules for Service, Notification,
  • Dependency and ScheduledDowntime objects.
  • Tip: Use icinga2 object list --type Host to
  • list all host objects after running
  • configuration validation (icinga2 daemon -C).
    */

/*

  • This is an example host based on your
  • local host's FQDN. Specify the NodeName
  • constant in constants.conf or use your
  • own description, e.g. "db-host-1".
    */

object 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" ]
}
}

@mcktr
Copy link
Member

mcktr commented Aug 15, 2017

@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.

@dnsmichi dnsmichi added the area/windows Windows agent and plugins label Aug 17, 2017
@dnsmichi
Copy link
Contributor

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.

@dnsmichi dnsmichi removed the help wanted Extra attention is needed label Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Windows agent and plugins bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants