Non existent macros are not replaced

Daniel Wittenberg daniel.wittenberg.r0ko at statefarm.com
Thu Mar 3 18:05:48 CET 2011


I'm not sure I quite understand then.  Where I've gotten bit by this is
where a value doesn't get passed from another script, maybe in that case
the value isn't available. So it's not a matter of RTFM, it's a matter
of a defined variable coming back with a null value.  Or am I missing
the point of this?

Dan

-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 
Sent: Thursday, March 03, 2011 10:54 AM
To: Nagios Developers List
Subject: Re: [Nagios-devel] Non existent macros are not replaced

On 03/03/2011 05:39 PM, Matthieu Kermagoret wrote:
> Hi list,
> 
> When using a non-existent macros in a command (like for example
> $SERVICEDESC$ in a host notification command), such macro is not
> replaced. It is instead left as-is on the command line.
> 
> Such construct is interpreted by the shell as a variable (usually
> empty) followed by a dollar sign which (usually) expands to a single
> dollar and lead users to believe that Nagios replace non-existent
> macros with a single dollar (see ticket #34
> http://tracker.nagios.org/view.php?id=34).
> 
> I believe this behavior is not intuitive and should therefore be
> modified to simply remove non-existent macros, as the attached patch
> does.
> 
> What do you think about it ?
> 

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. A completely unnecessary complication which would
only serve to limit Nagios' capabilities as a protection from a
completely harmless error caused by not RTFM'ing before typing.

While protecting users from making too many or too grave mistakes
is a fine thing indeed, it can be taken too far.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------
------
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 
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel

------------------------------------------------------------------------------
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