[icinga-checkins] icinga.org: icinga2/feature/improve-command-plugins-6487: Improve snmp CheckCommand, add snmpv3 CheckCommand.

git at icinga.org git at icinga.org
Mon Jun 16 00:17:36 CEST 2014


Module: icinga2
Branch: feature/improve-command-plugins-6487
Commit: 69a26d3fe66e72be27fdf9d9c5e67bc8ad0bd20e
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=69a26d3fe66e72be27fdf9d9c5e67bc8ad0bd20e

Author: Gerd von Egidy <gerd at egidy.de>
Date:   Mon Jun 16 00:17:07 2014 +0200

Improve snmp CheckCommand, add snmpv3 CheckCommand.

Refs #6487

---

 doc/6-configuring-icinga-2.md |   20 ++++++++++++++++++++
 itl/command-plugins.conf      |   26 ++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md
index ca46fc1..537e1af 100644
--- a/doc/6-configuring-icinga-2.md
+++ b/doc/6-configuring-icinga-2.md
@@ -2044,6 +2044,26 @@ 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.
+
+#### <a id="plugin-check-command-snmp"></a> snmpv3
+
+Check command object for the `check_snmp` plugin, using SNMPv3 authentication and encryption options.
+
+Custom Attributes:
+
+Name              | Description
+------------------|--------------
+snmpv3_address    | **Optional.** The host's address. Defaults to "$address$".
+snmpv3_user       | **Required.** The username to log in with.
+snmpv3_auth_alg   | **Optional.** The authentication algorithm. Defaults to SHA.
+snmpv3_auth_key   | **Required.** The authentication key.
+snmpv3_priv_alg   | **Optional.** The encryption algorithm. Defaults to AES.
+snmpv3_priv_key   | **Required.** The encryption key.
+snmpv3_oid        | **Required.** The SNMP OID.
+snmpv3_warn       | **Optional.** The warning threshold.
+snmpv3_crit       | **Optional.** The critical threshold.
 
 #### <a id="plugin-check-command-snmp-uptime"></a> snmp-uptime
 
diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index e1ee1ae..4ea1955 100644
--- a/itl/command-plugins.conf
+++ b/itl/command-plugins.conf
@@ -358,12 +358,38 @@ object CheckCommand "snmp" {
 		"-H" = "$snmp_address$"
 		"-o" = "$snmp_oid$"
 		"-C" = "$snmp_community$"
+		"-c" = "$snmp_crit$"
+		"-w" = "$snmp_warn$"
 	}
 
 	vars.snmp_address = "$address$"
 	vars.snmp_community = "public"
 }
 
+object CheckCommand "snmpv3" {
+	import "plugin-check-command"
+
+	command = PluginDir + "/check_snmp"
+
+	arguments = {
+		"-H" = "$snmpv3_address$"
+		"-P" = 3
+		"--seclevel" = "authPriv"
+		"-U" = "$snmpv3_user$"
+		"-a" = "$snmpv3_auth_alg$"
+		"-A" = "$snmpv3_auth_key$"
+		"-x" = "$snmpv3_priv_alg$"
+		"-X" = "$snmpv3_priv_key$"
+		"-o" = "$snmpv3_oid$"
+		"-c" = "$snmpv3_crit$"
+		"-w" = "$snmpv3_warn$"
+	}
+
+	vars.snmpv3_address = "$address$"
+	vars.snmpv3_auth_alg = "SHA"
+	vars.snmpv3_priv_alg = "AES"
+}
+
 object CheckCommand "snmp-uptime" {
 	import "snmp"
 



More information about the icinga-checkins mailing list