Non existent macros are not replaced

Matthieu Kermagoret mkermagoret at merethis.com
Thu Mar 3 17:39:48 CET 2011


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 ?

Best regards,

-- 
Matthieu KERMAGORET | Développeur

mkermagoret at merethis.com

MERETHIS est éditeur du logiciel Centreon.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios_invalid_macros_are_replaced_by_a_single_dollar.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20110303/23150203/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
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 
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list