For When You Can't Have The Real Thing
[ start | index | login ]
start > nagios > check_snmp

check_snmp

Created by dave. Last edited by dave, 6 years and 153 days ago. Viewed 11,129 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
(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:

ThisMeans
-w 20:Anything 20 or higher is NOT a warning
-c 17:Anything 17 or higher is NOT critical
-w :20Anything 20 or lower is NOT a warning
-c :17Anything 17 or lower is NOT critical
-w 19: -c 17:Warn below 19; Critical below 17
-w :20 -c :22Warn 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:')
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt