Reverse checks possible?
Israel Brewster
israel at frontierflying.com
Tue Jul 10 18:05:25 CEST 2007
On Jul 9, 2007, at 6:19 PM, Demetri Mouratis wrote:
> On Mon, 9 Jul 2007, Rogelio Bastardo wrote:
>
>> On 7/9/07, Patrick Morris <patrick.morris at hp.com> wrote:
>>>
>>> Sure. See the "negate" plugin.
>>
>>
>> Thanks!
>>
>> For whatever reason, I'm not getting what I'm expecting.
>>
>> Oddly, I get the same OK result, regardless of whether or not I
>> use the
>> negate command.
>>
>> e.g.
>>
>> [root at term-server plugins]# ./check_http -H www.google.com
>> HTTP OK HTTP/1.0 200 OK - 6045 bytes in 0.101 seconds
>> |time=0.101285s;;;0.000000
>> size=6045B;;;0
>> [root at term-server plugins]#
>>
>> and
>>
>> [root at term-server plugins]# ./negate "/usr/lib/nagios/plugins/
>> check_http -H
>> www.google.com"
>> HTTP OK HTTP/1.0 200 OK - 6043 bytes in 0.616 seconds
>> |time=0.615904s;;;0.000000
>> size=6043B;;;0
>>
>>
>> Not sure what exactly I'm doing wrong....
>>
>
>
> Look at the return code.
>
> # echo $?
>
> -D
>
Exactly- the negate plugin flips the return code, which is what
nagios actually uses to determine the unknown/critical/ok/warning
state of a host/service, not the returned status text. The reason for
this is that it would be rather difficult, if not impossible, to
negate the text itself- what is the opposite of "A"? While the status
text may seem to be one of a set number of options (UNKNOWN, OK,
WARNING, CRITICAL) in reality it is just a bunch of text that is
whatever the author of the plugin wanted it to be, and therefore has
no real "negative"
-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> 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
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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