Last active
July 3, 2019 13:52
-
-
Save rob-mosher/c9a1be37dc26fdf2377bb7599df0a3cc to your computer and use it in GitHub Desktop.
Example: Icinga2 Monitor Windows Services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Add the following within the "object Host NodeName { HERE }" block | |
* | |
* Service names can be found in "services.msc" by right-clicking | |
* the desired service and selecting "Properties" | |
*/ | |
vars.service_win_services["Service name 1"] = {} | |
vars.service_win_services["Service name 2"] = {} | |
vars.service_win_services["Service name 3"] = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* add the following anywhere within this file */ | |
apply Service "service-" for (service_win_service => config in host.vars.service_win_services) { | |
import "generic-service" | |
check_command = "service-windows" | |
vars += config | |
vars.service_win_service = service_win_service | |
notes = "Service check for " + service_win_service | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* TODO | |
* - add optional descriptions to vars.service_win_services examples | |
* | |
* THANK YOU | |
* to michi's http_vhost tutorial at the link below for the starting point for my gist: | |
* http://www.legendiary.at/2015/01/10/monitoring-vhosts-with-icinga-2-and-icinga-web-2/ | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment