]> granicus.if.org Git - icinga2/commitdiff
Add more options to snmp check
authorCarlos Cesario <carloscesario@gmail.com>
Thu, 26 Jun 2014 14:13:41 +0000 (11:13 -0300)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 27 Jun 2014 06:24:44 +0000 (08:24 +0200)
fixes #6581

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
doc/6-configuring-icinga-2.md
itl/command-plugins.conf

index c04eecbdbe59c1e87bed9777819adb6ec8ae261d..b6fbf4b2c7bcaf85907352f6deb4f6224c56a775 100644 (file)
@@ -2083,13 +2083,19 @@ Check command object for the `check_snmp` plugin.
 
 Custom Attributes:
 
-Name            | Description
-----------------|--------------
-snmp_address    | **Optional.** The host's address. Defaults to "$address$".
-snmp_oid        | **Required.** The SNMP OID.
-snmp_community  | **Optional.** The SNMP community. Defaults to "public".
-snmp_warn       | **Optional.** The warning threshold.
-snmp_crit       | **Optional.** The critical threshold.
+Name                | Description
+--------------------|--------------
+snmp_address        | **Optional.** The host's address. Defaults to "$address$".
+snmp_oid            | **Required.** The SNMP OID.
+snmp_community      | **Optional.** The SNMP community. Defaults to "public".
+snmp_warn           | **Optional.** The warning threshold.
+snmp_crit           | **Optional.** The critical threshold.
+snmp_string         | **Optional.** Return OK state if the string exact match with the output value
+snmp_ereg           | **Optional.** Return OK state if extended regular expression REGEX matches with the output value
+snmp_eregi          | **Optional.** Return OK state if case-insensitive extended REGEX matches with the output value
+snmp_label          | **Optional.** Prefix label for output value
+snmp_invert_search  | **Optional.** Invert search result and return CRITICAL state if found
+snmp_units          | **Optional.** Units label(s) for output value (e.g., 'sec.').
 
 #### <a id="plugin-check-command-snmp"></a> snmpv3
 
index 22c61907e0c78fb3a4d7aa238ae9afe72bd3b749..2105013133053998744659f3a53bd441f25d4d0d 100644 (file)
@@ -409,10 +409,20 @@ object CheckCommand "snmp" {
                "-C" = "$snmp_community$"
                "-c" = "$snmp_crit$"
                "-w" = "$snmp_warn$"
+               "-s" = "$snmp_string$"
+               "-r" = "$snmp_ereg$"
+               "-R" = "$snmp_eregi$"
+               "-l" = "$snmp_label$"
+               "-u" = "$snmp_units$"
+               "--invert-search" = {
+                       set_if = "$snmp_invert_search$"
+                       description = "Invert search result and return CRITICAL if found"
+               }
        }
 
        vars.snmp_address = "$address$"
        vars.snmp_community = "public"
+       vars.snmp_invert_search = false
 }
 
 object CheckCommand "snmpv3" {