[Nagiosplug-devel] [RFC] Plugins config file

Ton Voon ton.voon at altinity.com
Wed Oct 18 13:50:24 CEST 2006


On 18 Oct 2006, at 12:21, Gavin Carr wrote:

>> Plugins that support this new config file parsing of options take the
>> option (as Sean suggested) of
>>
>>   --extra-opts=[configfile][:stanzaname]
>
> Syntax quibble: how about 'configfile#section', like URL fragments?
> Colon is already used in host:/path/to/file forms, and in ranges.

I thought that too since it makes more sense. However the shell would  
think it was a comment unless you escaped or put quotes around it. If  
that is obvious enough, I'm happy with hash.

>> The [:stanzaname]
>> defines a stanza within the config file, otherwise defaults to name
>> of plugin (maybe reserve "main" as a stanza name - this config file
>> has given me some ideas for future stuff).
>>
>> An example stanza:
>>
>> [check_mysql]
>> username=tonvoon
>> password=secret
>>
>> So running "check_mysql -S --extra-opts=" should give the same result
>> as running "check_mysql -S --username=tonvoon --password=secret". If
>> fact, the variable names could just be the short option form:
>>
>> [check_mysql]
>> u=tonvoon
>> p=password
>>
>> But I'm guessing using that long names will be preferred.
>
> And just to clarify: you're saying that where an argument has multiple
> forms (even more than two), any of them would also be acceptable in
> the config file?

Yes, because it should be equivalent to running the expanded command  
on the command line. If there is a technical reason why u=tonvoon  
will cause more problems that username=tonvoon, then I'd be happy to  
drop the single syntax option.

Ton

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20061018/16cb573e/attachment.html>


More information about the Devel mailing list