From a4e2c48c969897ad425c22b46b5987232e7e8ad2 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 12 May 2014 12:25:14 +0200 Subject: [PATCH] Add check comment for NSClient++. Refs #5795 --- doc/4-monitoring-remote-systems.md | 42 ++++++------------------------ doc/9-appendix.md | 17 ++++++++++++ itl/command-plugins.conf | 20 ++++++++++++++ 3 files changed, 45 insertions(+), 34 deletions(-) diff --git a/doc/4-monitoring-remote-systems.md b/doc/4-monitoring-remote-systems.md index c56b3ad65..0b4bc9f05 100644 --- a/doc/4-monitoring-remote-systems.md +++ b/doc/4-monitoring-remote-systems.md @@ -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! - ### Icinga 2 Agent A dedicated Icinga 2 agent supporting all platforms and using the native diff --git a/doc/9-appendix.md b/doc/9-appendix.md index 22582f089..409d6c966 100644 --- a/doc/9-appendix.md +++ b/doc/9-appendix.md @@ -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". +#### 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. + #### apt Check command for the `check_apt` plugin. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 1d3d564ff..8f2b449e3 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -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 +} -- 2.40.0