[Nagiosplug-help] Questions using negate?

John Cockerham jcockerham at mydoconline.com
Wed Mar 5 05:25:21 CET 2003


We re-wrote negate as a simple perl script.  I have tried your
check_ping input with my version of negate and here is what I get:


root at lxxxx:[/home/nagios/etc]: /home/nagios/libexec/new-negate
/home/nagios/libexec/check_ping -H auspap01 -w 1000.0,100% -c
1000.0,100% -p 5
Command is: /home/nagios/libexec/check_ping -H host01 -w 1000.0,100% -c
1000.0,100% -p 5PING OK - Packet loss = 0%, RTA = 4.62 ms
Return code is 0
root at lapin:[/home/nagios/etc]: echo $?
2

The first return code is the actual return from the check_ping plugin,
the second $? output is the negated output.  Since check_ping produces
multiple return codes depending on the result, it is difficult to use a
generic negate plugin.  I have included our version of the plugin
"new-negate.  Hope this helps..

Good luck


On Tue, 2003-03-04 at 18:07, Rose David wrote:
> I have a device on my network that I normally should not be able to
> reach so
> would like to use the check_ping to see if I can reach it.  What it
> should
> actually do though is report as OK if unreachable and as DOWN if
> reachable,
> and negate sounds like it should fit the bill, but doesn't seem to be
> working.  I don't know if I am doing something wrong or if it only
> works
> with certain plugins, but here is the command I am running:
> 
> When I use the following line, I get a "negate: Unknown argument - w".
>  
> command_line $USER1$/negate $USER1$/check_ping -H $ARG1$ -w
> 1000.0,100% -c \
> 1000.0,100% -p 5
> 
> So, I try putting the command it is running in quotes (see below) and
> I get
> a "/usr/rest/of/path/negate problem - No data recieved from host"
> error
> message.
> 
> command_line $USER1$/negate "$USER1$/check_ping -H $ARG1$ -w
> 1000.0,100% \
> -c 1000.0,100% -p 5"
> 
> I did update the plugins to the most recent version available, so a
> negate
> -V returns "negate (nagios-plugins 1.3.0) 1.5".  Could anyone let me
> know
> what I am doing wrong?
> 
> Thanks,
> David
-- 

John Cockerham
Sr. Network Administrator

MyDocOnline, Inc.
Wk: (512) 246-4851
Cell: (512) 750-9011
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new-negate
Type: text/x-perl
Size: 176 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20030305/68ae9c0a/attachment.pl>


More information about the Help mailing list