On-Demand Macros issue

Bryan Loniewski brylon at jla.rutgers.edu
Wed May 25 17:31:10 CEST 2005


To answer my own question..

After looking through the code, it appears what I want is not possible. The code seems 
to parse on the ":" and believes what follows it ($ARG1$) to be the hostname which is 
then passed to a function that looks up other attributes for that hostname in memory.

Thus, the expansion of $ARG1$ is not possible inside an On-Demand macro.

Would others find this useful if a patch is applied?

_________________________
Bryan Loniewski
Rutgers University
NBCS - Systems Programmer

On Wed, 25 May 2005, Bryan Loniewski wrote:

> After traversing through the archives for an answer and coming up short.. has 
> anyone found it possible to do the following?
>
> define command{
>        command_name    foo
> #        command_line    $USER2$/foo $HOSTADDRESS:some_host_name$ # WORKS 
> FINE
>        command_line    $USER2$/foo $HOSTADDRESS:$ARG1$$ # Where 
> $ARG1$=some_host_name
>        }
>
> that is, namely having $ARG1$ expanded *first* followed by the whole 
> On-Demand macro?
> I've tried all sorts of combo's to get this to work but no luck..
>
> Any ideas?
>
>
> _________________________
> Bryan Loniewski
> Rutgers University
> NBCS - Systems Programmer
>


-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list