Skip to content

Instantly share code, notes, and snippets.

@rob-mosher
Last active July 3, 2019 13:52
Show Gist options
  • Save rob-mosher/c9a1be37dc26fdf2377bb7599df0a3cc to your computer and use it in GitHub Desktop.
Save rob-mosher/c9a1be37dc26fdf2377bb7599df0a3cc to your computer and use it in GitHub Desktop.
Example: Icinga2 Monitor Windows Services
/*
* 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"] = {}
/* 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
}
/* 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