[Nagiosplug-devel] [PATCH] negate: Let the user specify what end result of specific return code
Thomas Guyot-Sionnest
Thomas at zango.com
Wed Jun 20 23:20:40 CEST 2007
> -----Original Message-----
> From: nagiosplug-devel-bounces at lists.sourceforge.net [mailto:nagiosplug-
> devel-bounces at lists.sourceforge.net] On Behalf Of Andreas Ericsson
> Sent: June 11, 2007 5:50
> To: Nagios Plugin Development Mailing List
> Subject: Re: [Nagiosplug-devel] [PATCH] negate: Let the user specify what
> end result of specific return code
>
> Ton Voon wrote:
> > Hi Andreas,
> >
> > On 23 May 2007, at 15:46, Andreas Ericsson wrote:
> >
> >> This patch lets the user specify how to translate the various return
> >> codes from the commands the negate plugin runs, rather than just
> >> having
> >> the hardcoded option to go with.
> >>
> >> This is specified as such:
> >> --critical=warning (to make critical translate to warning)
> >> --warning=ok
> >>
> >
> > This looks interesting and I wrote some tests to try this out, but I
> > don't appear to be getting the right results. Could have a look at it?
> >
>
> Oh gawds, this went dormant for a long time. Higher prio projects, illness
> and vacations came in between.
>
> I happened to build the patch from the wrong branch. The correct one is
> attached.
Thanks Andreas... I just found use for that new negate, though it still fail
Ton's tests. I noticed that the run_simple function does not handle properly
ok state. At line 169:
if (WEXITSTATUS(status){
...
}
return STATE_UNKNOWN;
Did you sent the wrong patch again? After looking at the current code, it
looks like there are *many* things that need to be polished as well.
Also I have these two suggestions:
1. The default behaviour should only happen if none of -o, -w, -c and -u are
present (That's what is in negate.pl too). I.e. in the last example above
the correct result would be:
0 0 2 3
2. We should accept numeric values:
$ ./negate -w 2
If you're not going to work on this anymore I'll finish up the work whenever
I can (Not before 2-3 weeks...).
Thanks,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3076 bytes
Desc: not available
URL: <http://nagios-plugins.org/archive/devel/attachments/20070620/8c0ab130/attachment.bin>
More information about the Devel
mailing list