From 73e09876009422a21f4180daf17ed6138f5ef8ae Mon Sep 17 00:00:00 2001 From: "Dolf Schimmel (Freeaqingme)" Date: Fri, 20 Feb 2015 21:33:52 +0100 Subject: [PATCH 1/4] ITL: Implement various options for the 'snmp' CheckCommand, including mib-list refs #8498 Signed-off-by: Gunnar Beutner --- doc/9-monitoring-remote-systems.md | 5 +++++ itl/command-plugins.conf | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/doc/9-monitoring-remote-systems.md b/doc/9-monitoring-remote-systems.md index 92d65c11c..ebeb37d57 100644 --- a/doc/9-monitoring-remote-systems.md +++ b/doc/9-monitoring-remote-systems.md @@ -634,12 +634,17 @@ have the `snmp-community` custom attribute. check_command = "snmp" vars.snmp_oid = "1.3.6.1.2.1.1.3.0" + vars.snmp_miblist = "DISMAN-EVENT-MIB" assign where host.vars.snmp_community != "" } Additional SNMP plugins are available using the [Manubulon SNMP Plugins](7-icinga-template-library.md#snmp-manubulon-plugin-check-commands). +If no `snmp_miblist` is specified the plugin will default to `ALL`. As the number of available MIB files +on the system increases so will the load generated by this plugin if no `MIB` is specified. +As such, it is recommended to always specify at least one `MIB`. + ### SSH Calling a plugin using the SSH protocol to execute a plugin on the remote server fetching diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index a543612e4..1fbdf7293 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -749,6 +749,13 @@ object CheckCommand "snmp" { set_if = "$snmp_invert_search$" description = "Invert search result and return CRITICAL if found" } + "-P" = "$snmp_version$" + "-m" = "$snmp_miblist$" + "--rate-multiplier" = "$snmp_rate_multiplier$" + "--rate" = { + set_if = "$snmp_rate$" + description = "Enable rate calculation" + } } vars.snmp_address = {{ From 96ad5287dca7fd6de753755d1483e2ff957a0bfb Mon Sep 17 00:00:00 2001 From: "Dolf Schimmel (Freeaqingme)" Date: Sat, 21 Feb 2015 14:25:15 +0100 Subject: [PATCH 2/4] ITL: Add support for GETNEXT in SNMP CheckCommand refs #8498 Signed-off-by: Gunnar Beutner --- itl/command-plugins.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 1fbdf7293..5ffb48951 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -756,6 +756,10 @@ object CheckCommand "snmp" { set_if = "$snmp_rate$" description = "Enable rate calculation" } + "-n" = { + set_if = "$snmp_getnext$" + description = "Use SNMP GETNEXT instead of SNMP GET" + } } vars.snmp_address = {{ From 9fff92442ce1960bf92baddf4bdd03c47619cd27 Mon Sep 17 00:00:00 2001 From: "Dolf Schimmel (Freeaqingme)" Date: Tue, 24 Feb 2015 21:07:53 +0100 Subject: [PATCH 3/4] Add documentation for the new SNMP ITL custom attributes refs #8498 Signed-off-by: Gunnar Beutner --- doc/7-icinga-template-library.md | 5 +++++ doc/9-monitoring-remote-systems.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index a5b27658c..e3d103a47 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -598,6 +598,11 @@ snmp_eregi | **Optional.** Return OK state if case-insensitive extended 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.'). +snmp_version | **Optional.** Version to use. E.g. 1, 2, 2c or 3. +snmp_miblist | **Optional.** MIB's to use, comma separated. Defaults to "ALL". +snmp_rate_multiplier | **Optional.** Converts rate per second. For example, set to 60 to convert to per minute. +snmp_rate | **Optional.** Boolean. Enable rate calculation. +snmp_getnext | **Optional.** Boolean. Use SNMP GETNEXT. Defaults to false. snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 10 seconds. ### snmpv3 diff --git a/doc/9-monitoring-remote-systems.md b/doc/9-monitoring-remote-systems.md index ebeb37d57..6ff49bb67 100644 --- a/doc/9-monitoring-remote-systems.md +++ b/doc/9-monitoring-remote-systems.md @@ -641,7 +641,7 @@ have the `snmp-community` custom attribute. Additional SNMP plugins are available using the [Manubulon SNMP Plugins](7-icinga-template-library.md#snmp-manubulon-plugin-check-commands). -If no `snmp_miblist` is specified the plugin will default to `ALL`. As the number of available MIB files +If no `snmp_miblist` is specified the plugin will default to `ALL`. As the number of available MIB files on the system increases so will the load generated by this plugin if no `MIB` is specified. As such, it is recommended to always specify at least one `MIB`. From 9ab0b2c19e1c0a0d5640e4c2cf7d503046c3cbd3 Mon Sep 17 00:00:00 2001 From: "Dolf Schimmel (Freeaqingme)" Date: Tue, 24 Feb 2015 21:41:29 +0100 Subject: [PATCH 4/4] Add .mailmap alias for Freeaqingme refs #8498 Signed-off-by: Gunnar Beutner --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index c7fc49152..e9f2417c1 100644 --- a/.mailmap +++ b/.mailmap @@ -5,3 +5,4 @@ Gunnar Beutner Jean-Marcel Flach +Dolf Schimmel