[Nagiosplug-devel] [ nagiosplug-Bugs-3306880 ] Negate doesn't seem to do anything

SourceForge.net noreply at sourceforge.net
Fri May 27 06:03:25 CEST 2011


Bugs item #3306880, was opened at 2011-05-24 08:16
Message generated for change (Comment added) made by dermoth
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3306880&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: release-1.4.15
Status: Pending
Resolution: Invalid
Priority: 5
Private: No
Submitted By: MikeM-2468 (mikem-2468)
Assigned to: Thomas Guyot-Sionnest (dermoth)
Summary: Negate doesn't seem to do anything

Initial Comment:
The negate plugin doesn't seem to work as it should.  With or without negate, I get the same results.  I used the following command as a test but get the same result with or without using negate.

negate check_ping -H 192.168.100.1 -w 3000.0,80% -c 5000.0,100% -p 5

I've tried v1.4.15 and v1.4.15.-24-g5ebe.  Running gcc version 4.3.2 (Debian 4.3.2-1.1) x86.

----------------------------------------------------------------------

>Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2011-05-27 00:03

Message:
Yes, it actually change the nagios status, which is not directly connected
to the output text. Normally the text always match the status, but negate
alters the nagios status only (not the output text).

This is particularly useful when different statuses are handled
differently (ex. email vs pagers). Also usually email subjects use a nagios
macro which returns the correct status text, with the plugin output in the
body.

And as I pointed out, the -s switch (available in recent versions) can be
used to replace the output text as well.

----------------------------------------------------------------------

Comment By: MikeM-2468 (mikem-2468)
Date: 2011-05-26 08:46

Message:
OK.  The Manpage seemed to indicate that it would change OK to CRITICAL and
vice versa.  I get 0 vs 2 with your example.

----------------------------------------------------------------------

Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2011-05-26 08:34

Message:
Negate by default only change the return code, which is what matters for
Nagios. try:

check_ping -H 192.168.100.1 -w 3000.0,80% -c 5000.0,100% -p 5; echo $?

vs.

negate check_ping -H 192.168.100.1 -w 3000.0,80% -c 5000.0,100% -p 5; echo
$?

You can also use the -s switch in negate to also change the returned
string, but it'll only work for standard results like "CRITICAL" - ex a
plugin returning "Error" will not be altered besides the return code.

I'm marking the bug as invalid for now, I'll reopen if you can demonstrate
an issue.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3306880&group_id=29880




More information about the Devel mailing list