From 04177cb73633f8f1962e85658b0850eca5b0214a Mon Sep 17 00:00:00 2001 From: Petr Ruzicka Date: Tue, 4 Aug 2015 14:50:40 +0200 Subject: [PATCH] ITL: Improve snmpv3 CheckCommand section fixes #9827 Signed-off-by: Michael Friedrich --- doc/7-icinga-template-library.md | 31 +++++++------ itl/command-plugins.conf | 80 +++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 25 deletions(-) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index b16fd9008..93104955a 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -733,19 +733,24 @@ Check command object for the `check_snmp` plugin, using SNMPv3 authentication an Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): -Name | Description -------------------|-------------- -snmpv3_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. -snmpv3_user | **Required.** The username to log in with. -snmpv3_auth_alg | **Optional.** The authentication algorithm. Defaults to SHA. -snmpv3_seclevel | **Optional.** The security level. Defaults to authPriv. -snmpv3_auth_key | **Required,** The authentication key. Required if `snmpv3_seclevel` is set to `authPriv` otherwise optional. -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. -snmpv3_label | **Optional.** Prefix label for output value. +Name | Description +---------------------|-------------- +snmpv3_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmpv3_getnext | **Optional.** Use SNMP GETNEXT instead of SNMP GET. +snmpv3_seclevel | **Optional.** The security level. Defaults to authPriv. +snmpv3_auth_alg | **Optional.** The authentication algorithm. Defaults to SHA. +snmpv3_user | **Required.** The username to log in with. +snmpv3_auth_key | **Required,** The authentication key. Required if `snmpv3_seclevel` is set to `authPriv` otherwise optional. +snmpv3_priv_key | **Required.** The encryption key. +snmpv3_oid | **Required.** The SNMP OID. +snmpv3_priv_alg | **Optional.** The encryption algorithm. Defaults to AES. +snmpv3_warn | **Optional.** The warning threshold. +snmpv3_crit | **Optional.** The critical threshold. +snmpv3_string | **Optional.** Return OK state (for that OID) if STRING is an exact match. +snmpv3_ereg | **Optional.** Return OK state (for that OID) if extended regular expression REGEX matches. +snmpv3_eregi | **Optional.** Return OK state (for that OID) if case-insensitive extended REGEX matches. +snmpv3_invert_search | **Optional.** Invert search result and return CRITICAL if found +snmpv3_label | **Optional.** Prefix label for output value. ## snmp-uptime diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 2674979c0..59d6306f2 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -1057,18 +1057,74 @@ object CheckCommand "snmpv3" { command = [ PluginDir + "/check_snmp" ] arguments = { - "-H" = "$snmpv3_address$" - "-P" = 3 - "--seclevel" = "$snmpv3_seclevel$" - "-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$" - "-l" = "$snmpv3_label$" + "-H" = { + value = "$snmpv3_address$" + description = "Host name, IP Address, or unix socket (must be an absolute path)" + } + "-n" = { + set_if = "$snmpv3_getnext$" + description = "Use SNMP GETNEXT instead of SNMP GET" + } + "-P" = { + value = 3 + description = "SNMP protocol version" + } + "-L" = { + value = "$snmpv3_seclevel$" + description = "SNMPv3 securityLevel" + } + "-a" = { + value = "$snmpv3_auth_alg$" + description = "SNMPv3 auth proto" + } + "-U" = { + value = "$snmpv3_user$" + description = "SNMPv3 username" + } + "-A" = { + value = "$snmpv3_auth_key$" + description = "SNMPv3 authentication password" + } + "-X" = { + value = "$snmpv3_priv_key$" + description = "SNMPv3 privacy password" + } + "-o" = { + value = "$snmpv3_oid$" + description = "Object identifier(s) or SNMP variables whose value you wish to query" + } + "-x" = { + value = "$snmpv3_priv_alg$" + description = "SNMPv3 priv proto (default DES)" + } + "-w" = { + value = "$snmpv3_warn$" + description = "Warning threshold range(s)" + } + "-c" = { + value = "$snmpv3_crit$" + description = "Critical threshold range(s)" + } + "-s" = { + value = "$snmpv3_string$" + description = "Return OK state (for that OID) if STRING is an exact match" + } + "-r" = { + value = "$snmpv3_ereg$" + description = "Return OK state (for that OID) if extended regular expression REGEX matches" + } + "-R" = { + value = "$snmpv3_eregi$" + description = "Return OK state (for that OID) if case-insensitive extended REGEX matches" + } + "--invert-search" = { + set_if = "$snmpv3_invert_search$" + description = "Invert search result and return CRITICAL if found" + } + "-l" = { + value = "$snmpv3_label$" + description = "Prefix label for output from plugin" + } } vars.snmpv3_address = "$check_address$" -- 2.40.0