<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2656.60">
<TITLE>RE : [Nagios-users] Re: On-Demand Macros issue</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>> From: Bryan Loniewski [<A HREF="mailto:brylon@jla.rutgers.edu">mailto:brylon@jla.rutgers.edu</A>] </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Would others find this useful if a patch is applied?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> >        command_line    $USER2$/foo $HOSTADDRESS:$ARG1$$ # Where </FONT>
<BR><FONT SIZE=2>> > $ARG1$=some_host_name</FONT>
</P>

<P><FONT SIZE=2>Unfortunately, as the macro starting and ending tags are the same ($), I think that you cannot implement such an extension in an unambiguous way. Here is an example:</FONT></P>

<P><FONT SIZE=2>If you get :</FONT>
</P>

<P><FONT SIZE=2>$HOSTADDRESS:pre$ARG1$post$</FONT>
</P>

<P><FONT SIZE=2>It is impossible to choose between :</FONT>
</P>

<P>        <FONT SIZE=2>($HOSTADDRESS:pre$)ARG1($post$)</FONT>
<BR><FONT SIZE=2>And     ($HOSTADDRESS:pre($ARG1$)post$)</FONT>
</P>

<P><FONT SIZE=2>And it is still harder if you get something like '$HOSTADDRESS:pre$ARG1$ARG2$'.</FONT>
</P>

<P><FONT SIZE=2>To conclude, unless you define some new tags for macro expansion, I think that this extension is not possible. And defining some new tags would bring many compatibility problems.</FONT></P>

</BODY>
</HTML>