Actions component

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagios_aws
Posts: 76
Joined: Wed May 18, 2016 3:34 am

Actions component

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Actions component

Post by rkennedy »

Can you show us the command / service definition you're attempting to use?
Former Nagios Employee
nagios_aws
Posts: 76
Joined: Wed May 18, 2016 3:34 am

Re: Actions component

Post 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
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Actions component

Post 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.
Former Nagios employee
Locked