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

Andreas Ericsson ae at op5.se
Thu May 29 17:54:13 CEST 2008


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?

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231




More information about the Devel mailing list