RFC: Conditional macros in object configuration

Thomas Guyot-Sionnest Thomas at zango.com
Fri May 4 21:20:35 CEST 2007


Hi List,

I know it's a bit late in Nagios 3 development process to suggest such a
feature, but I see great advantage of implementing this so I'm asking others
if they feel this should go in Nagios 3 as well.

First some background. For some time now I've defined various check commands
that look like this:

check_command $USER1$/check_something -H $HOSTADDRESS$ -p $ARG1$ 80
--other-arguments

While I knew since the beginning that this was definitely a hack, it worked
and I never complained. But as my setups get more complex I needed to define
more "optional args" and it doesn't always work. Also since these hacks are
totally unsupported they can easily break on Nagios-plugins upgrades and
sometimes produce unexpected results when you least expect them.

What I'd like to see is ways to define optional and conditional macros.
There's two things that could be done.

1. Bash-style conditional macros

check_command -H $ARG1|HOSTADDRESS$ -p $ARG1|_DEFAULTHTTPPORT$

More complex ones: $(_OPT1&_OPT2)|(_OPT3|_OPT4&_OPT5)$

Basically the same using || and && in bash.

2. C-style conditional macros

$ARG1?-p $ARG1$:-p 80$

$ARG1?-p $ARG1$:$


What do you think? I'm very open to changes in the syntax; what I'm
suggesting is only the feature no matter how it's implemented... 

Does it sounds like a good idea?

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3076 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070504/88357450/attachment.bin>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list