Page 1 of 1

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

Posted: Thu Mar 03, 2011 4:54 pm
by Guest
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 [email protected]
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.





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