UPS check SNMP not alerting

Marc Powell marc at ena.com
Tue Sep 16 15:03:45 CEST 2008


On Sep 16, 2008, at 3:33 AM, Richard Savage wrote:

> Hi
>
> I have a slight issue in that the check that i am using to check the
> UPS  battery via SNMP is not alerting correctly.  Im running Nagios 3
> with Nagios plug ins and NRPE.  This particular check is being run  
> over
> SNMP using the MIB for percentage of battery remaining.  As can be  
> seen
> below the Nagios front end is reporting OK even though the battery  
> is at
> 89%.  I have set the critical alert to be at 100%.

Do you?

> Battery time remaining    OK    09-16-2008 09:21:18        18d 17h 14m
> 35s        18d 17h 14m 35s        1/4        Battery Remaining OK -  
> 89 %
>
> This is the command being used to get the percentage of battery  
> remaining:
>
> define command {
>        command_name    check_ups_minutes
>        command_line    $USER1$/check_snmp -H $HOSTADDRESS$ -C local -o
> SNMPv2-SMI::mib-2.33.1.2.4.0 -c 100 -l 'Battery Remaining' -u '%'
>        }
>
> Surely this would mean that if the value dropped below 100% it would
> alert?  Why is this not happening??

An incorrect assumption. check_snmp --help (*emphasis mine*) --

-c, --critical=*INTEGER_RANGE(s)*
     Range(s) which will *not* result in a CRITICAL status
...
- Bare integers are interpreted as *upper limits*.

So you've indicated that anything *up to* 100 is not a critical  
status. If you want anything from 0-99 to be critical, you'll want to  
use this section --

- If specified in the order 'max:min' a non-OK state will be returned  
if the
   result is within the (inclusive) range.

$USER1$/check_snmp -H ... -c 99:0 ... should achieve that.

--
Marc


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list