From 2dc4b968d9f247c965636498bd0f7ce6b4b2fc72 Mon Sep 17 00:00:00 2001 From: Gerd von Egidy Date: Mon, 16 Jun 2014 00:17:07 +0200 Subject: [PATCH] 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 16a0ac4de..64159e528 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. + +#### 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. #### snmp-uptime diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index e1ee1ae4e..4ea195568 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" -- 2.40.0