Page 1 of 1

Actions component

Posted: Wed Aug 24, 2016 3:53 am
by nagios_aws
Hello,

I want to run some commands like this :

/path/to/my/tool tool $ARGS1$@$HOSTADDRESS$

Where $ARGS1$ is the argument passed in each service and $HOSTADDRESS$ the address of the host hosting this service.

but the macros seems to not be interpreted when I run it, do you have any clues ? or I'm using this wrong ?

thank you for your answer

Re: Actions component

Posted: Wed Aug 24, 2016 10:25 am
by rkennedy
Can you show us the command / service definition you're attempting to use?

Re: Actions component

Posted: Thu Aug 25, 2016 2:21 am
by nagios_aws
I'm using a script that I developed myself in the service, i'm using it like this :

$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_flex.pl -a $ARG1$

it works very well for every services.

I tried to set up an action in another way to do the same thing, but arguments doesn't seem to work.
you can see the actions in attached file.
the tool is called, I get the output, but no parameters are given to this tool

Re: Actions component

Posted: Thu Aug 25, 2016 3:49 pm
by tmcdonald
The $MACRO$-style macros will not work that way in the Actions component:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

The macros are formatted like %macro% and the above documentation has a list on the last page of which macros are available.

Also note that things like $ARG1$ will not have any meaning since that only applies when a check is being run.