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
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.
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
+}