#575 check_snmp - integer parsing

Release (specify)

Plugin Version: check_snmp v1.4.16 (nagios-plugins 1.4.16)
Plugin Name: check_snmp
Operating System: Centos Linux 5
Architecture: Intel 32bit
Compiler: gcc

I am monitoring the power supply status on an APC PDU device. The snmp query returns integer 1 when status is good and integer 2 when status bad.

In order to test this with check_snmp I'm attempting to set a '-c' value that will make the check fail. I would expect that setting '-c 1' should result in CRITICAL and yet it doesn't:

./check_snmp -H -o . -C netben -c 1 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] .
iso. = INTEGER: 1
SNMP OK - 1 | iso.

I've found that if I use '-c 2:2', I get the result I would expect....but yet that makes no sense!?

./check_snmp -H -o . -C netben -c 2:2 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] .
iso. = INTEGER: 1
SNMP CRITICAL - *1* | iso.


  • Porjo

    Porjo - 2012-10-02

    Looking at the source code I realised that I was simply misunderstanding the way the threshold range checking works. I've been using Nagios for years and never realised this!!

    This page (linked from the check_snmp man page) explains it well:


  • Porjo

    Porjo - 2012-10-02
    • status: open --> closed-invalid

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks