[Nagiosplug-devel] RFC: Plugins config file (final proposal)
Thomas Guyot-Sionnest
dermoth at aei.ca
Tue Jan 30 07:06:37 CET 2007
On 29/01/07 11:16 PM, Ethan Galstad wrote:
> 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. :-)
Hi there,
I missed the discussion, but I noted some people are trying to set
environment variables as well. Could this method allow setting
environment variables as well?
ex (proposal):
[check_stuff]
ENV {
STUFF_NAME=foo
STUFF_BLAH='foo bar'
}
range=12:20
Would set the STUFF_NAME and STUFF_COUNT environment variables in
addition to setting --range to 12:20
Thomas
More information about the Devel
mailing list