[Nagiosplug-devel] RFC: Plugins config file (final proposal)

Ton Voon ton.voon at altinity.com
Thu Feb 22 12:38:37 CET 2007


On 18 Feb 2007, at 04:11, Gavin Carr wrote:

> On Fri, Feb 16, 2007 at 09:14:06AM +0000, Ton Voon wrote:
>> On 16 Feb 2007, at 07:07, sean finney wrote:
>>
>>> i would say that both the plugins and Nagios::Plugin should have
>>> a single default location, which equates to the same config root
>>> where the rest of the files would go in a default "make install",
>>> with a sensible filename.
>>>
>>> as long as both of the above provide a way to override this setting
>>> (i.e. by setting passing some cmdline option when building/ 
>>> installing
>>> or having the location in an easily patchable location), i don't see
>>> there being any problem.  plus, one will always be able to override
>>> it at runtime too.
>>
>> OK. So if $DEFAULT_INI_FILE=/usr/local/nagios/etc/nagios-plugins.ini
>> is somewhere in Nagios::Plugin.pm, then when the Debian maintainer
>> packages it, they can patch just this one line? Sounds fair.
>
> But that doesn't solve the install from CPAN problem though, right? I
> think we're probably going to have add install-time code there too to
> search for likely directories and get explicit confirmation from the
> user, if possible ...

What about this?

Have NP_DEFAULT_INI_FILE as an environment variable. If this is set  
at runtime for Nagios::Plugin, use that location. Otherwise default "/ 
usr/local/nagios/etc/nagios-plugins.ini".

I notice for XML::SAX::Expat that you can set some "compile time  
environment variables" to specify where the expat libs are. So if  
NP_DEFAULT_INI_FILE environment variable is set at "perl Makefile.PL"  
time, switch the default to that file.

So we'd have a way of overriding at build time and at runtime, with a  
reasonable default value.

Ton

http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon







More information about the Devel mailing list