Page 1 of 1

Re: [Nagios-devel] Non existent macros are not replaced

Posted: Thu Mar 03, 2011 5:37 pm
by Guest
On 03/03/2011 05:54 PM, Andreas Ericsson wrote:
> I think that would be quite stupid, as it would prevent users from
> using shell variables in their commands, or multiple dollar-signs
> for that matter.

Not quite, the handling of escaped dollar signs ("$$") is in a separate
branch immediately preceding the "unknown macro name" branch. Hence, the
properly escaped notation ("$$FOO$$BAR" in Nagios, becomes "$FOO$BAR" on
shell level) would still be available.

(I admit I wasn't aware that it's the *shell* which reduces "$FOO$" to
"$", rather than Nagios.)

On one hand, trusting Nagios to leave "$FOO$" be (rather than properly
configuring "$$FOO$$") is not supported. On the other hand, that has
never been enforced, and enforcing it now promises to break lots of
real-world configurations. I'd say that if it *is* to be enforced, it
would need to be specifically caught and pointed out by the config
verification. And *that* is a can of worms, because nothing keeps you
from using a command in different contexts with different sets of macros
being available or not ...

Kind regards,
J. Bern
--=20
Jochen Bern, Systemingenieur --- LINworks GmbH
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP =3D D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C2=
7
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Gesch=E4ftsf=FChrer Metin Dogan, Oliver Mic=
hel





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]