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

Ethan Galstad nagios at nagios.org
Tue Jan 30 05:16:55 CET 2007


Gavin Carr wrote:
> Hi Ton,
> 
> On Mon, Jan 29, 2007 at 09:45:48AM +0000, Ton Voon wrote:
>> I'm trying to wrap up this RFC from October last year (http:// 
>> thread.gmane.org/gmane.network.nagios.plugins.devel/4199) so that we  
>> can have some text written in the developer-guidelines before  
>> starting work on implementing it.
>>
>> This is a summary of the thread on it. I think I have all the angles  
>> covered, but please let me know if not.
>>
>>
>> PROBLEM
>>
>> There are security issues with passing user authentication  
>> information into some plugins via the command line. We would like the  
>> use of configuration files, secured at the file level, allowing  
>> configuration variables on a per-plugin basis.
>>
>>
>> PROPOSED SOLUTION
>>
>> A new option is allowed: --extra-opts. The idea is this option is  
>> "replaced" with configuration options within a configuration file.
> 
> I made a first-pass at this back in November in perl, and the main piece 
> that was tricky was the in-place replacement that you seemed to be keen 
> on i.e.
> 
> [plugin]
> username=bar
> 
>   --username=foo --extra-opts=plugin
> 
> mapping to '--username=foo --username=bar'.
> 
> I just wonder if anyone is going to need to do this in practice? Mostly
> it seems to me that, if anything, we'd just want to override config file
> parameters i.e.
> 
>   --extra-opts=plugin --username=foo
> 
> but not
>   
>   --username=foo --extra-opts=plugin
> 
> (if they're additive, of course, it doesn't make a difference).
> 
> So what do you think about saying instead: --extra-opts arguments always 
> precede explicit arguments i.e.
> 
>   --username=foo --extra-opts=plugin
> 
> is in effect:
> 
>   --extra-opts=plugin --username=foo
> 
> ?
> 
> 
> Cheers,
> Gavin
> 

The proposed config file solution is a great idea!

I would suggest that command-line arguments/variables always override 
those found in the config file, no matter where they're located in the 
command line.  I would imagine the only reason someone would override 
default values is because they want to override them. :-)


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org




More information about the Devel mailing list