]> granicus.if.org Git - icinga2/commitdiff
Docs: Add example for Windows service monitoring with check_nscp_api 5583/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Mon, 18 Sep 2017 14:56:03 +0000 (16:56 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Mon, 18 Sep 2017 14:56:03 +0000 (16:56 +0200)
doc/06-distributed-monitoring.md

index 957acb87046bf3caeb22773194742d7b71282411..229f4e7085116a7a79dbb6e46405c45f6200ca5a 100644 (file)
@@ -2374,6 +2374,38 @@ which defaults to `host.address`.
 You can verify the check execution by looking at the `Check Source` attribute
 in Icinga Web 2 or the REST API.
 
+If you want to monitor specific Windows services, you could use the following example:
+
+    [root@icinga2-master1.localdomain /]# cd /etc/icinga2/zones.d/master
+    [root@icinga2-master1.localdomain /etc/icinga2/zones.d/master]# vim hosts.conf
+
+    object Host "icinga2-client1.localdomain" {
+        check_command = "hostalive"
+        address = "192.168.56.111"
+        vars.client_endpoint = name //follows the convention that host name == endpoint name
+        vars.os_type = "Windows"
+        vars.nscp_api_password = "icinga"
+        vars.services = [ "Windows Update", "wscsvc" ]
+    }
+
+    [root@icinga2-master1.localdomain /etc/icinga2/zones.d/master]# vim services.conf
+
+    apply Service "nscp-api-" for (svc in host.vars.services) {
+      import "generic-service"
+
+      check_command = "nscp_api"
+      command_endpoint = host.vars.client_endpoint
+
+      //display_name = "nscp-service-" + svc
+
+      vars.nscp_api_host = "localhost"
+      vars.nscp_api_query = "check_service"
+      vars.nscp_api_password = host.vars.nscp_api_password
+      vars.nscp_api_arguments = [ "service=" + svc ]
+
+      ignore where host.vars.os_type != "Windows"
+    }
+
 #### NSCLient++ with nscp-local <a id="distributed-monitoring-windows-nscp-check-local"></a>
 
 The [Windows setup](06-distributed-monitoring.md#distributed-monitoring-setup-client-windows) already allows