Page 2 of 2
Re: Incorrect Status Reporting
Posted: Mon May 21, 2012 1:23 pm
by nscott
And you reloaded nagios after changing it? Because that should definitely change it.
Re: Incorrect Status Reporting
Posted: Mon May 21, 2012 1:25 pm
by buee
nscott wrote:And you reloaded nagios after changing it? Because that should definitely change it.
I've reloaded and restarted it.
Re: Incorrect Status Reporting
Posted: Tue May 22, 2012 8:36 am
by buee
Ok, so I took out the -w and -c statements in both the service definition and the command itself and now the thing returns OK and is green in Nagios. Does that mean that it will return a critical for any state besides "3"?
Re: Incorrect Status Reporting
Posted: Tue May 22, 2012 10:02 am
by nscott
buee,
Does that mean that you left the -s or -r in? You need some kind of threshold for Nagios to determine whats good and whats bad, so if there are no threshold arguments it will always return OK.
Re: Incorrect Status Reporting
Posted: Tue May 22, 2012 2:34 pm
by buee
I left the -c in
Code: Select all
root@monitor:/etc/nagios3/conf.d# /usr/lib/nagios/plugins/check_snmp -H 10.0.4.2 -o .1.3.6.1.2.1.33.1.4.1.0 -C 1RC0MM -P 2c -c 3:3
SNMP OK - 3 | iso.3.6.1.2.1.33.1.4.1.0=3
root@monitor:/etc/nagios3/conf.d# /usr/lib/nagios/plugins/check_snmp -H 10.0.4.2 -o .1.3.6.1.2.1.33.1.4.1.0 -C 1RC0MM -P 2c -c 2:2
SNMP CRITICAL - *3* | iso.3.6.1.2.1.33.1.4.1.0=3
So if it returns 2, it goes critical. What's I'd love is a warning at 5 and critical at 2. 5 is if it kicks to battery (lost AC power and should probably closely monitor the situation), 2 is "other" i.e. something is broken. 3 is normal operating mode. Before, I had the -w 5 and -c 2 and it worked. I can't seem to do that now.
Re: Incorrect Status Reporting
Posted: Tue May 22, 2012 3:02 pm
by nscott
Unfortunately check_snmp doesn't support every single range on of the Nagios plugins ranges, however, maybe something like this might work?
check_snmp -H 10.0.4.2 -o .1.3.6.1.2.1.33.1.4.1.0 -C 1RC0MM -P 2c -c 4 -w 3:
This will yield a warning on anything LESS THAN (but not equal to) 3 and a critical on anything GREATER THAN (but not equal to) 4. I'm not sure what other number values your UPS can kick out, but if it pretty much just uses those three values, it should work.