Lieberts UPS

Subhendu Ghosh sghosh at sghosh.org
Tue May 31 15:26:45 CEST 2005


On Sun, 29 May 2005, Rejo Zenger wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> ++ 12/05/05 23:33 -0500 - Marc Powell:
>>> mode.  So effectively I could be checking an SNMP string oid every 5
>>> minutes and it will be erroring, until it actually goes into battery mode,
>>> when its status will then become ok.  I kinda want the reverse of
>>> this...so Im only alerted when the oid is present.
> [...]
>> Use the negate plugin as a wrapper. It flips the exit code of the
>> wrapped plugin. CRITICAL becomes OK and vice-versa.
>
> That doesn't seem to work overhere:
>
> bottebijl:/usr/local/nagios# libexec/negate "/usr/local/nagios/libexec/check_snmp -H 217.77.129.10 -o .1.3.6.1.2.1.33.1.2.3.0 -c 20"
> SNMP CRITICAL - *24*
>
> bottebijl:/usr/local/nagios# /usr/local/nagios/libexec/check_snmp -H 217.77.129.10 -o .1.3.6.1.2.1.33.1.2.3.0 -c 20
> SNMP CRITICAL - *24*
>
> This is a check to see how many minutes are remaining on the UPS. What I
> need is a warning if that one is less 22 minutes and a critical if it's
> less than 20.
>
> When specified 20 as a criticial, 24 will return critical state. If 18,
> than it will return an ok state. That is to be inverted. If 0-20 minutes
> remaining should give critical, 20-22 remaining should be warning and
> more than 22 should give a ok state. I can't seem to get that behaviour.
>
>

Note - Nagios only looks at the return code for status - not the text 
string in the output.  you need to check $? verify that the appropriate OK 
code is being sent.

-- 
-sg


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
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