[Nagiosplug-devel] How to know, which nagios-version calls a plugin?

Thomas Guyot-Sionnest thomas at zango.com
Thu May 29 18:09:40 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andreas Ericsson wrote:
| Ingo Lantschner wrote:
|> Hi,
|> I am developing plugins for netapp-filers in Perl. Depending on the
|> Nagios-version, the output of the plugin should either be shorter
|> (Version 2) or longer (version 3). I can do this by introducing a
|> parameter like --nagversion but it would be more implementation-
|> friendly to have way, that the plugin can determine, from which nagios-
|> version it is called?
|>
|> Any idea?
|>
|
| Patch Nagios to always supply it as an environment variable.
| Major-version only should be enough.
|
| Although I must say I'm incredibly against a plugin that
| will act one way when run by Nagios and another way when
| run by an unsuspecting user from the command-prompt.
| Is there no way the information can be distilled down to
| some reasonably descriptive yet sufficiently short format?

If there is really a big interest in this I would suggest a Nagios macro
that change based on the Nagios version and then future Nagios-plugins
version could add a standard parameter for receiving the version string.
The version string would be standardized so that on newer strings we
could just use the most recent behavior (in case it's not the default).

I don't thinks this would be really useful unless there's plans for
adding more features or supporting different formats in the future. As
long as we want to keep the plugin output simple I'd just add a standard
switch for multi-line output (that would eventually be removed once
nagios 2 becomes deprecated).

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIPtVE6dZ+Kt5BchYRAsHUAJ4wzcdOplLUvb3fXaUMouR4tw6I6QCgw74v
vL8eMceRVsWvD7quMxR4X0Q=
=Skj7
-----END PGP SIGNATURE-----




More information about the Devel mailing list