[Nagiosplug-devel] [RFC] Plugins config file
sean finney
seanius at seanius.net
Mon Oct 16 19:13:24 CEST 2006
On Mon, 2006-10-16 at 06:36 -0700, william(at)elan.net wrote:
> Common way to deal with this is to have option that reads additional
> arguments from specified file, i.e. it would be:
> Usage: check_db_query_rowcount [-v] -q <query> -w <warn-count>
> -c <crit-count> [--config <config-file>]
> where the file would contain
> -d <dsn> -u user> -p <pass>
this is a really interesting idea. i especially like it because it's
generalizable to any kind of plugin, as long as it implemented that
feature. i might suggest "--extra-opts" or similar as an alternative
name to "--config" though.
> Another option is to have environment variables but not actually expand
> during call, i.e.
> check_db_query_rowcount -p '$DB_PASS' -u '$DB_USER' ...
> Be carefull though to only read passed shell variables and not allow
> reading actual variables used in program.
unfortunately, no--you can read exported environment variables via ps as
well :(
> The processing of command-line options in one or both ways above could
> potentially be done be done by optional plugin library and not something
> each plugin writer has to worry about - this would in fact make it
> simple to further expand to common format config file for plugins.
yes. though we would have to ensure that calls to process_arguments()
and the like were idempotent, or at least combine the two sets of
arguments into a single string before calling the function.
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: <https://www.monitoring-plugins.org/archive/devel/attachments/20061016/7aa8c61a/attachment.sig>
More information about the Devel
mailing list