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

Andreas Ericsson ae at op5.se
Tue Jan 30 10:03:15 CET 2007


sean finney wrote:
> On Tue, 2007-01-30 at 01:06 -0500, Thomas Guyot-Sionnest wrote:
>> 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
> 
> i'd like to make the suggestion that if we do this, instead of using the
> block-within-braces syntax (which doesn't aesthetically fit well with
> the ini format


But it does fit with the Nagios config syntax.


> imo and would be harder to parse), we do something like
> 

... and it's not really harder to parse in any language I can think of.

> [check_stuff]
> 	env STUFF_NAME=foo
> 	env STUFF_BLAH='foo bar'
> 	range=12:20
> 

If you use ini-style, you end up with the problem of "how do we do with
subsections?" such as when one plugin wants one environment (check_oracle)
and another plugin needs something else.

Compare

check_stuff {
	env {
		STUFF_NAME = foo
		STUFF_BLAH = foo bar
	}
	range = 12:20
}

with

[check_stuff]
	[env]
		STUFF_NAME = foo
		STUFF_BLAH = foo bar
	range = 12:20


or

[check_stuff]
	range = 12:20

[check_stuff env]
	STUFF_NAME = foo
	STUFF_BLAH = foo bar

Using protected prefixes doesn't scale well, is error-prone and requires
exception-handling for all the protected prefixes.

> furthermore, you example brought up an issue which will need to be
> clarified... what's the specification for parsing quotes?
> 

Why use quotes? We're talking C/Perl here, aren't we?

-- 
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