<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Nagiosplug-help] Questions using negate?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Thank you for your response and input.  I have now used your script and it</FONT>
<BR><FONT SIZE=2>has gotten me farther along than I have been able to this point.  Here is</FONT>
<BR><FONT SIZE=2>the catch.  When I run this on the command line, it works just as</FONT>
<BR><FONT SIZE=2>advertised, switching the return codes from 2 to 0 or from 0 to 2.  However,</FONT>
<BR><FONT SIZE=2>when I run it in nagios as a command, either a Critical or an OK state on</FONT>
<BR><FONT SIZE=2>the check_ping shows up as OK.  Using the same command, I get the following</FONT>
<BR><FONT SIZE=2>two results:</FONT>
</P>

<P><FONT SIZE=2>Status          Status Information</FONT>
<BR><FONT SIZE=2>OK                      CRITICAL - Plugin timed out after 10 seconds  </FONT>
<BR><FONT SIZE=2>OK                      PING OK - Packet loss = 20%, RTA = 245.95 ms </FONT>
</P>

<P><FONT SIZE=2>Any further input as to what I might do to get this to work?</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>> We re-wrote negate as a simple perl script.  I have tried your</FONT>
<BR><FONT SIZE=2>> check_ping input with my version of negate and here is what I get:</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> root@lxxxx:[/home/nagios/etc]: /home/nagios/libexec/new-negate</FONT>
<BR><FONT SIZE=2>> /home/nagios/libexec/check_ping -H auspap01 -w 1000.0,100% -c</FONT>
<BR><FONT SIZE=2>> 1000.0,100% -p 5</FONT>
<BR><FONT SIZE=2>> Command is: /home/nagios/libexec/check_ping -H host01 -w </FONT>
<BR><FONT SIZE=2>> 1000.0,100% -c</FONT>
<BR><FONT SIZE=2>> 1000.0,100% -p 5PING OK - Packet loss = 0%, RTA = 4.62 ms</FONT>
<BR><FONT SIZE=2>> Return code is 0</FONT>
<BR><FONT SIZE=2>> root@lapin:[/home/nagios/etc]: echo $?</FONT>
<BR><FONT SIZE=2>> 2</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> The first return code is the actual return from the check_ping plugin,</FONT>
<BR><FONT SIZE=2>> the second $? output is the negated output.  Since check_ping produces</FONT>
<BR><FONT SIZE=2>> multiple return codes depending on the result, it is </FONT>
<BR><FONT SIZE=2>> difficult to use a</FONT>
<BR><FONT SIZE=2>> generic negate plugin.  I have included our version of the plugin</FONT>
<BR><FONT SIZE=2>> "new-negate.  Hope this helps..</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Good luck</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> John Cockerham</FONT>
<BR><FONT SIZE=2>> Sr. Network Administrator</FONT>
</P>

</BODY>
</HTML>