From fe6dc00a85a6a64c2d992d9c7d33d28c08eb445f Mon Sep 17 00:00:00 2001 From: Carlos Cesario Date: Fri, 8 Aug 2014 09:06:44 -0300 Subject: [PATCH] Add some manubulon snmp plugins refs #6650 --- doc/6-configuring-icinga-2.md | 160 +++++++++++++++++++++++++++ etc/icinga2/constants.conf.cmake | 4 + itl/plugin-commands-manubulon.conf | 172 +++++++++++++++++++++++++++++ 3 files changed, 336 insertions(+) create mode 100644 itl/plugin-commands-manubulon.conf diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md index 495a1d149..73b6fd5d2 100644 --- a/doc/6-configuring-icinga-2.md +++ b/doc/6-configuring-icinga-2.md @@ -2307,3 +2307,163 @@ Check command object for the `check_running_kernel` plugin provided by the `nagios-plugins-contrib` package on Debian. The `running_kernel` check command does not support any vars. + + +## SNMP Manubulon Plugin Check Commands + +### Overview + +The SNMP Manubulon Plugin Check Commands provides example configuration for plugin check commands provided by the Snmp Manubulon plugins. + +The SNMP manubulon plugin check commands assume that there's a global constant named `ManubulonPluginDir` which contains the path of the plugins from the Snmp Manubulon page. + +### Checks you can make by host type + +**N/A** : nothing of this type to check. + +**SNMP** : yes with simple SNMP query. + +**??** : not tested because useless most of the time. + +**Specific** : name of the script to look at for platform specific checks. + + + Host type | Interface | storage | load/cpu | mem | process | env | specific + ------------------------|------------|----------|-----------|-----|----------|-----|------------------------- + Linux | Yes | Yes | Yes | Yes | Yes | No | + Windows | Yes | Yes | Yes | Yes | Yes | No | check_snmp_win.pl + Cisco router/switch | Yes | N/A | Yes | Yes | N/A | Yes | + HP router/switch | Yes | N/A | Yes | Yes | N/A | No | + Bluecoat proxy | Yes | SNMP | Yes | SNMP| No | Yes | + CheckPoint on SPLAT | Yes | Yes | Yes | Yes | Yes | No | check_snmp_cpfw.pl + CheckPoint on Nokia IP | Yes | Yes | Yes | No | ?? | No | check_snmp_vrrp.pl + Boostedge | Yes | Yes | Yes | Yes | ?? | No | check_snmp_boostedge.pl + AS400 | Yes | Yes | Yes | Yes | No | No | + NetsecureOne Netbox | Yes | Yes | Yes | ?? | Yes | No | + Radware Linkproof | Yes | N/A | SNMP | SNMP| No | No | check_snmp_linkproof_nhr
check_snmp_vrrp.pl + IronPort | Yes | SNMP | SNMP | SNMP| No | Yes | + Cisco CSS | Yes | ?? | Yes | Yes | No | ?? | check_snmp_css.pl + + +#### snmp-load + +Check command object for the check_snmp_load.pl plugin. + +Custom Attributes: + + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$". +snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false". +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false". +snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false". +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false". +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_load_type | **Optional.** Load type. Default to "stand". Check all availables snmp load. +snmp_perf | **Optional.** Enable perfdata values. Defaults to "true". + +#### snmp-memory + +Check command object for the check_snmp_mem.pl plugin. + +Custom Attributes: + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$". +snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false". +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false". +snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false". +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false". +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_perf | **Optional.** Enable perfdata values. Defaults to "true". + +#### snmp-storage + +Check command object for the check_snmp_storage.pl plugin. + +Custom Attributes: + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$". +snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false". +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false". +snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false". +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false". +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_storage_name | **Optional.** Storage name. Default to regex "^/$$". Check more options in snmp storage. +snmp_perf | **Optional.** Enable perfdata values. Defaults to "true". + +#### snmp-int + +Check command object for the check_snmp_int.pl plugin. + +Custom Attributes: + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$". +snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false". +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false". +snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false". +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false". +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_interface | **Optional.** Network interface name. Default to regex "eth0". +snmp_interface_perf | **Optional.** Check the input/ouput bandwidth of the interface. Defaults to "true". +snmp_interface_bits | **Optional.** Make the warning and critical levels in KBits/s. Defaults to "true". +snmp_interface_64bit | **Optional.** Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps. Defaults to "false". +snmp_perf | **Optional.** Enable perfdata values. Defaults to "true". + +#### snmp-process + +Check command object for the check_snmp_process.pl plugin. + +Custom Attributes: + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$". +snmp_nocrypt | **Optional.** Define SNMP encryption. If set **snmp_v3** needs to be set. Defaults to "false". +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to "false". +snmp_v3 | **Optional.** SNMP version to 3. Defaults to "false". +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to "false". +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_process_name | **Optional.** Name of the process (regexp). No trailing slash!. Defaults to ".*". +snmp_perf | **Optional.** Enable perfdata values. Defaults to "true". diff --git a/etc/icinga2/constants.conf.cmake b/etc/icinga2/constants.conf.cmake index c3ceb7322..d2337226f 100644 --- a/etc/icinga2/constants.conf.cmake +++ b/etc/icinga2/constants.conf.cmake @@ -6,6 +6,10 @@ /* The directory which contains the plugins from the Monitoring Plugins project. */ const PluginDir = "@ICINGA2_PLUGINDIR@" + +/* The directory which contains the Manubulon plugins from http://nagios.manubulon.com/index_snmp.html. */ +const ManubulonPluginDir = "@ICINGA2_PLUGINDIR@" + /* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`. * This should be the common name from the API certificate. */ diff --git a/itl/plugin-commands-manubulon.conf b/itl/plugin-commands-manubulon.conf new file mode 100644 index 000000000..49d6c26cd --- /dev/null +++ b/itl/plugin-commands-manubulon.conf @@ -0,0 +1,172 @@ +/* main snmp-manubulon template */ +template CheckCommand "snmp-manubulon-command" { + import "plugin-check-command", + + arguments = { + "-H" = "$snmp_address$" + "-C" = { + set_if = "$snmp_nocrypt$" + value = "$snmp_community$" + } + "-p" = "$snmp_port$" + "-v2c" = { + set_if = "$snmp_v2$" + } + "-l" = { + set_if = "$snmp_v3$" + value = "$snmp_login$" + } + "-x" = { + set_if = "$snmp_v3$" + value = "$snmp_password$" + } + "-L" = { + set_if = "$snmp_v3_use_authprotocol$" + value = "$snmp_authprotocol$" + } + "-X" = { + set_if = "$snmp_v3_use_privpass$" + value = "$snmp_privpass$" + } + + "-w" = "$snmp_warn$" + "-c" = "$snmp_crit$" + } + + vars.snmp_address = "$address$" + vars.snmp_nocrypt = true + vars.snmp_community = "public" + vars.snmp_v2 = false + vars.snmp_v3 = false + vars.snmp_login = "snmpuser" + vars.snmp_v3_use_privpass = false + vars.snmp_v3_use_authprotocol = false + vars.snmp_authprotocol = "md5,des" +} + + +/** snmp load + * Url reference: http://nagios.manubulon.com/snmp_load.html + **/ +object CheckCommand "snmp-load" { + import "snmp-manubulon-command", + + command = [ ManubulonPluginDir + "/check_snmp_load.pl" ] + + arguments += { + "-T" = "$snmp_load_type$" + "-f" = { + set_if = "$snmp_perf$" + } + } + + vars.snmp_load_type = "stand" + vars.snmp_warn = 85 + vars.snmp_crit = 95 + vars.snmp_perf = true +} + + +/** Memory and swap usage on Linux given by Net-snmp + * Memory usage on cisco routers or Pix + * For other systems use check_snmp_storage.pl + * Url reference: http://nagios.manubulon.com/snmp_mem.html + **/ + +object CheckCommand "snmp-memory" { + import "snmp-manubulon-command", + + command = [ ManubulonPluginDir + "/check_snmp_mem.pl" ] + + arguments += { + "-f" = { + set_if = "$snmp_perf$" + } + } + + vars.snmp_warn = "94,50" + vars.snmp_crit = "98,80" + vars.snmp_perf = true +} + + +/** snmp storage - Disk/Memory + * Url reference: http://nagios.manubulon.com/snmp_storage.html + **/ +object CheckCommand "snmp-storage" { + import "snmp-manubulon-command", + + command = [ ManubulonPluginDir + "/check_snmp_storage.pl" ] + + arguments += { + "-m" = "$snmp_storage_name$" + "-f" = { + set_if = "$snmp_perf$" + } + } + + vars.snmp_storage_name = "^/$$" + vars.snmp_warn = 80 + vars.snmp_crit = 90 + vars.snmp_perf = true +} + + +/** snmp network interfaces + * Url reference: http://nagios.manubulon.com/snmp_int.html + **/ +object CheckCommand "snmp-interface" { + import "snmp-manubulon-command", + + command = [ ManubulonPluginDir + "/check_snmp_int.pl" ] + + arguments += { + "-n" = "$snmp_interface$" + "-k" = { + set_if = "$snmp_interface_perf$" + } + "-B" = { + set_if = "$snmp_interface_bits$" + } + "--64bits" = { + set_if = "$snmp_interface_64bit$" + } + "-f" = { + set_if = "$snmp_perf$" + } + } + + vars.snmp_interface = "eth0" + vars.snmp_interface_perf = true + vars.snmp_interface_bits = true + vars.snmp_interface_64bit = false + vars.snmp_warn = "300,400" + vars.snmp_crit = "0,600" + vars.snmp_perf = true +} + + +/** snmp process + * Url reference: http://nagios.manubulon.com/snmp_process.html + **/ +object CheckCommand "snmp-process" { + import "snmp-manubulon-command", + + command = [ ManubulonPluginDir + "/check_snmp_process.pl" ] + + arguments += { + "-n" = { + description = "Regex service name eg. ^apache2$" + value = "$snmp_process_name$" + } + "-F" = { + set_if = "$snmp_perf$" + } + } + + vars.snmp_process_name = ".*" + vars.snmp_warn = 0 + vars.snmp_crit = 0 + vars.snmp_perf = true +} +