[Nagiosplug-devel] [ nagiosplug-Bugs-3573832 ] check_snmp - integer parsing
SourceForge.net
noreply at sourceforge.net
Tue Oct 2 21:16:26 CEST 2012
Bugs item #3573832, was opened at 2012-10-02 09:13
Message generated for change (Comment added) made by porjo38
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3573832&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parsing problem
Group: Release (specify)
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Ian (porjo38)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_snmp - integer parsing
Initial Comment:
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 10.254.254.119 -o .1.3.6.1.4.1.318.1.1.12.4.1.1.0 -C netben -c 1 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 10.254.254.119:161 .1.3.6.1.4.1.318.1.1.12.4.1.1.0
iso.3.6.1.4.1.318.1.1.12.4.1.1.0 = INTEGER: 1
SNMP OK - 1 | iso.3.6.1.4.1.318.1.1.12.4.1.1.0=1
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 10.254.254.119 -o .1.3.6.1.4.1.318.1.1.12.4.1.1.0 -C netben -c 2:2 -v
/usr/bin/snmpget -t 1 -r 5 -m '' -v 1 [authpriv] 10.254.254.119:161 .1.3.6.1.4.1.318.1.1.12.4.1.1.0
iso.3.6.1.4.1.318.1.1.12.4.1.1.0 = INTEGER: 1
SNMP CRITICAL - *1* | iso.3.6.1.4.1.318.1.1.12.4.1.1.0=1
----------------------------------------------------------------------
>Comment By: Ian (porjo38)
Date: 2012-10-02 12:16
Message:
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:
http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3573832&group_id=2988
More information about the Devel
mailing list