[icinga-checkins] icinga.org: icinga2/support/2.0: Add more options to snmp check

git at icinga.org git at icinga.org
Fri Jun 27 08:25:09 CEST 2014


Module: icinga2
Branch: support/2.0
Commit: f27ea30000326c0673c2d9d2a6f9bfa82f2b9442
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=f27ea30000326c0673c2d9d2a6f9bfa82f2b9442

Author: Carlos Cesario <carloscesario at gmail.com>
Date:   Thu Jun 26 11:13:41 2014 -0300

Add more options to snmp check

fixes #6581

Signed-off-by: Gunnar Beutner <gunnar.beutner at netways.de>

---

 doc/6-configuring-icinga-2.md |   20 +++++++++++++-------
 itl/command-plugins.conf      |   10 ++++++++++
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md
index c04eecb..b6fbf4b 100644
--- a/doc/6-configuring-icinga-2.md
+++ b/doc/6-configuring-icinga-2.md
@@ -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
 
diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index 22c6190..2105013 100644
--- a/itl/command-plugins.conf
+++ b/itl/command-plugins.conf
@@ -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" {



More information about the icinga-checkins mailing list