[Nagiosplug-devel] RFC: Plugins config file (final proposal)
sean finney
seanius at seanius.net
Wed Jan 31 16:19:59 CET 2007
hey ton,
On Wed, 2007-01-31 at 12:50 +0000, Ton Voon wrote:
> QUOTING IN CONFIG FILE
i think we should be very, very clear on this. my opinion is that
we shouldn't do any quote parsing/interpretation, and pass what
is given verbatim to the plugin. so for example
[check_myname]
fullname=Sean Finney
would be the equivalent of
./check_myname --fullname='Sean Finney'
and
[check_myname]
fullname="Sean Finney"
would be
./check_myname --fullname='"Sean Finney"'
and that as andreas suggested, we allow for escaping single characters
with a backslash character (which wouldn't be necessary in any of the
above, but might be necessary for some other reason).
maybe we should just pony-up and do a formal grammar for it?
inifile := (discarded|stanza)*
discarded := (whitespace)*(commentchar freetext)? newline
freetext := [^(newline)]*
newline := '\n'
commentchar := "#" | ';'
stanza := start declarations
start := "[" name "]" newline
name := [[:alnum:]]*
declarations := (declaration declarations) | nothing
declaration := whitespace name whitespace "=" freetext newline
not sure if that covers everything... for example can a stanza have no
declarations?
> It appears that there is not a specific standard for ini files
> (http://en.wikipedia.org/wiki/INI_file), so I think to move the
fwiw, i took a look at the only C implementation mentioned in the wiki
page there, and it definitely will not meet our needs. specifically
there's no way to iterate across all of the declarations for a specific
stanza (to use the terms given above). i also looked quickly through
the debian package repository and didn't find any (C) libraries
available for this, though there were some in perl which might work.
sean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://nagios-plugins.org/archive/devel/attachments/20070131/b34eceed/attachment.sig>
More information about the Devel
mailing list