Non existent macros are not replaced
Andreas Ericsson
ae at op5.se
Thu Mar 3 17:54:03 CET 2011
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
More information about the Developers
mailing list