Non existent macros are not replaced

Jochen Bern Jochen.Bern at LINworks.de
Thu Mar 3 18:37:07 CET 2011


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
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 



More information about the Developers mailing list