[Nagiosplug-devel] New function for N::P
Thomas Guyot-Sionnest
thomas at zango.com
Wed Sep 19 17:52:39 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ton Voon wrote:
> On 19 Sep 2007, at 08:46, Thomas Guyot-Sionnest wrote:
>
>> I'd like to add a new function (max_state) to N::P but I never played
>> with perl libs, so I'll let it to more experienced programmers.
>
> It is available in N::P::Functions already, though there is probably
> a documentation hole if it is not documented in N::P. I note it also
> has the same bug in giving precedence to OK above UNKNOWN and
> DEPENDENT. Do you want to try and patch that? Make sure you run "make
> test"!
I "fixed" it and wrote some looping code to compare the two
implementation with all possible values. However I realized that some
plugins might have wanted to return OK if one of the checks returns
UNKNOWN (i.e. the service is available but there's some information we
couldn't get). Maybe I could create max_state_alt (or better name?) so
that we have both possible behavior.
The other thing it the N::P's behavior of returning UNKNOWN if ALL
values are out of bound (i.e. "5", "-1") which isn't the way the C
version works. I have no problem with that (and it make some sense
actually; normaly the plugin shouldn't use anything else) but I think it
shouldn't return OK if ANY value is out of bound. I assume we can safely
ignore Nagios 1 "-1" return code too ....
In short, my suggestion is:
max_state: CRITICAL, WARNING, [unknown value = UNKNOWN], OK, UNKNOWN,
DEPENDENT
max_state_alt?: CRITICAL, WARNING, UNKNOWN, DEPENDENT, [unknown value =
UNKNOWN], OK
I'm open to comments...
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG8UXH6dZ+Kt5BchYRAkdKAKCRuxvOisj9bjS1iyGFBGALwIqmewCeJsXP
MHvNFdczzwUgORaXl09TXvA=
=NavD
-----END PGP SIGNATURE-----
More information about the Devel
mailing list