(19 July 2012)
Ranges On check_snmp
So when you are dealing with check_snmp and defining the warning and critical ranges, you have to be aware that the ranges you put are the ones which
do not trigger the warning or critical. (Which is ass-backwards IMO.)
So for example:
This | Means |
---|
-w 20: | Anything 20 or higher is NOT a warning |
-c 17: | Anything 17 or higher is NOT critical |
-w :20 | Anything 20 or lower is NOT a warning |
-c :17 | Anything 17 or lower is NOT critical |
-w 19: -c 17: | Warn below 19; Critical below 17 |
-w :20 -c :22 | Warn above 20; Critical above 22 |
At this point I'm presuming that if both ranges are triggered, the critical over-rides the warning.
Example Implementation
/etc/nagios/objects/commands.cfg:
# 'check_snmp_range' command definition
define command{
command_name check_snmp_range
command_line $USER1$/check_snmp -H $HOSTADDRESS$ -o $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$
}
/etc/nagios/objects/macros.m4:
define(`DOSNMP',`define service{
use generic-service
host_name $1
service_description SNMP
check_command check_snmp_range!$2!$3!$4!$5
} ')dnl
/etc/nagios/objects/customer.m4, checking a UPS battery-runtime object, warning below 18 minutes and critical below 16:
DOSNMP(`gw-ups1',`1.3.6.1.4.1.476.1.42.3.5.1.18.0',`MyCommunity',`18:',`16:')