Add more options to snmp-interface command

Add more options to snmp-interface command based on conf file attached on ticket #7136.

fixes #7136

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
Carlos Cesario 2014-11-26 15:16:55 -02:00 committed by Gunnar Beutner
parent 8254c98e12
commit 4c9fe5fd5b
2 changed files with 57 additions and 24 deletions

View File

@ -2560,7 +2560,7 @@ Check command object for the [check_snmp_int.pl](http://nagios.manubulon.com/snm
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".
@ -2571,13 +2571,20 @@ snmp_login | **Optional.** SNMP version 3 username. Defaults to "sn
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_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_bits_bytes | **Optional.** Output performance data in bits/s or Bytes/s. **Depends** on snmp_interface_kbits set to "true". Defaults to "true".
snmp_interface_percent | **Optional.** Output performance data in % of max speed. Defaults to "false".
snmp_interface_kbits | **Optional.** Make the warning and critical levels in KBits/s. Defaults to "true".
snmp_interface_megabytes | **Optional.** Make the warning and critical levels in Mbps or MBps. **Depends** on snmp_interface_kbits set to "true". 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_interface_errors | **Optional.** Add error & discard to Perfparse output. Defaults to "true".
snmp_interface_noregexp | **Optional.** Do not use regexp to match interface name in description OID. Defaults to "false".
snmp_interface_delta | **Optional.** Delta time of perfcheck. Defaults to "300" (5 min).
snmp_warncrit_percent | **Optional.** Make the warning and critical levels in % of reported interface speed. If set **snmp_interface_megabytes** needs to be set to "false". Defaults to "false".
snmp_perf | **Optional.** Enable perfdata values. Defaults to "true".
#### <a id="plugin-check-command-snmp-process"></a> snmp-process

View File

@ -85,8 +85,8 @@ object CheckCommand "snmp-load" {
}
vars.snmp_load_type = "stand"
vars.snmp_warn = "85"
vars.snmp_crit = "95"
vars.snmp_warn = 85
vars.snmp_crit = 95
vars.snmp_perf = true
}
@ -153,12 +153,31 @@ object CheckCommand "snmp-interface" {
"-k" = {
set_if = "$snmp_interface_perf$"
}
"-Y" = {
set_if = "$snmp_interface_bits_bytes$"
}
"-y" = {
set_if = "$snmp_interface_percent$"
}
"-B" = {
set_if = "$snmp_interface_bits$"
set_if = "$snmp_interface_kbits$"
}
"-M" = {
set_if = "$snmp_interface_megabytes$"
}
"--64bits" = {
set_if = "$snmp_interface_64bit$"
}
"-e" = {
set_if = "$snmp_interface_errors$"
}
"-r" = {
set_if = "$snmp_interface_noregexp$"
}
"-d" = "$snmp_interface_delta$"
"-u" = {
set_if = "$snmp_interface_warncrit_percent$"
}
"-f" = {
set_if = "$snmp_perf$"
}
@ -166,8 +185,15 @@ object CheckCommand "snmp-interface" {
vars.snmp_interface = "eth0"
vars.snmp_interface_perf = true
vars.snmp_interface_bits = true
vars.snmp_interface_bits_bytes = true
vars.snmp_interface_percent = false
vars.snmp_interface_kbits = true
vars.snmp_interface_megabytes = true
vars.snmp_interface_64bit = false
vars.snmp_interface_errors = true
vars.snmp_interface_noregexp = false
vars.snmp_interface_delta = 300
vars.snmp_interface_warncrit_percent = false
vars.snmp_warn = "300,400"
vars.snmp_crit = "0,600"
vars.snmp_perf = true