]> granicus.if.org Git - icinga2/commitdiff
Add check comment for NSClient++.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 12 May 2014 10:25:14 +0000 (12:25 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 12 May 2014 10:30:30 +0000 (12:30 +0200)
Refs #5795

doc/4-monitoring-remote-systems.md
doc/9-appendix.md
itl/command-plugins.conf

index c56b3ad6509cb4a0cbc7a810b3a77c766918861a..0b4bc9f052f28d2da88e11029f5606b18850bf77 100644 (file)
@@ -103,52 +103,26 @@ known for its magnificent Windows support. There are alternatives like the WMI i
 but using `NSClient++` will allow you to run local scripts similar to check plugins fetching
 the required output and performance counters.
 
-The NSClient++ agent uses its own configuration format while `check_nt`
-can be embedded into the Icinga 2 `CheckCommand` configuration syntax.
+You can use the `check_nt` plugin from the Monitoring Plugins project to query NSClient++.
+Icinga 2 provides the [nscp check command](#plugin-check-command-nscp) for this:
 
 Example:
 
-    object CheckCommand "check_nscp" {
-      import "plugin-check-command"
-
-      command = [
-        PluginDir + "/check_nt",
-        "-H", "$address$",
-        "-p", "$port$",
-        "-v", "$remote_nscp_command$",
-        "-l", "$partition$",
-        "-w", "$warn$",
-        "-c", "$crit$",
-        "-s", "$pass$"
-      ]
-
-      vars = {
-        "port" = "12489"
-        "pass" = "supersecret"
-      }
-    }
-
-    object Service "users" {
+    object Service "disk" {
       import "generic-service"
   
       host_name = "remote-windows-host"
 
-      check_command = "check_nscp"
+      check_command = "nscp"
 
-      vars += {
-        remote_nscp_command = "USEDDISKSPACE"
-        partition = "c"
-        warn = "70"
-        crit = "80"
-      }
+      vars.nscp_variable = "USEDDISKSPACE"
+      vars.nscp_params = "c"
+      vars.nscp_warn = 70
+      vars.nscp_crit = 80
     }
 
 For details on the `NSClient++` configuration please refer to the [official documentation](http://www.nsclient.org/nscp/wiki/doc/configuration/0.4.x).
 
-> **Note**
-> 
-> The format of the `NSClient++` configuration file has changed from 0.3.x to 0.4!
-
 ### <a id="agent-based-checks-icinga2-agent"></a> Icinga 2 Agent
 
 A dedicated Icinga 2 agent supporting all platforms and using the native
index 22582f0893b38264d575b3e2ba6dc15577f92f02..409d6c96649af32806889aeee50a1c781b1985e0 100644 (file)
@@ -304,6 +304,23 @@ snmp_address    | **Optional.** The host's address. Defaults to "$address$".
 snmp_oid        | **Optional.** The SNMP OID. Defaults to "1.3.6.1.2.1.1.3.0".
 snmp_community  | **Optional.** The SNMP community. Defaults to "public".
 
+#### <a id="plugin-check-command-nscp"></a> nscp
+
+Check command object for the `check_nt` plugin.
+
+Custom Attributes:
+
+Name            | Description
+----------------|--------------
+nscp_address    | **Optional.** The host's address. Defaults to "$address$".
+nscp_port       | **Optional.** The NSClient++ port. Defaults to 12489.
+nscp_password   | **Optional.** The NSClient++ password.
+nscp_variable   | **Required.** The variable that should be checked.
+nscp_params     | **Optional.** Parameters for the query.
+nscp_warn       | **Optional.** The warning threshold.
+nscp_crit       | **Optional.** The critical threshold.
+nscp_timeout    | **Optional.** The query timeout in seconds.
+
 #### <a id="plugin-check-command-apt"></a> apt
 
 Check command for the `check_apt` plugin.
index 1d3d564ff1d5735c5e5b9d192f17e2e63e6dd782..8f2b449e3a1c01d44727044027853470ecd1db7f 100644 (file)
@@ -286,3 +286,23 @@ object CheckCommand "apt" {
                PluginDir + "/check_apt"
        ]
 }
+
+object CheckCommand "nscp" {
+       import "plugin-check-command"
+
+       command = PluginDir + "/check_nt"
+
+       arguments = {
+               "-H" = "$nscp_address$",
+               "-p" = "$nscp_port$",
+               "-s" = "$nscp_password$",
+               "-v" = { value = "$nscp_variable$", required = true },
+               "-l" = "$nscp_params$",
+               "-w" = "$nscp_warn$",
+               "-c" = "$nscp_crit$",
+               "-t" = "$nscp_timeout$
+       }
+
+       vars.nscp_address = "$address$"
+       vars.nscp_port = 12489
+}