Page 1 of 1

Using $ARG1$ macro in service Action URL

Posted: Thu Feb 14, 2013 10:27 am
by slinx
Hello,

We have a service defined in Nagios to check a host using ARG1 as the host's internal testing IP address, which is different from the host's defined HOSTADDRESS. I tried creating a service template with an Action URL like this:

Code: Select all

http://$ARG1$/cgi-bin/$SERVICEDESC$/test-for-up.html
When I click on the Extra Actions icon for the service, $SERVICEDESC$ gets replaced with the service description, but the IP that should be provided by $ARG1$ is blank. The check command does, however, work as expected by retrieving the test page from the IP specified by ARG1.

I also tried defining the Action URL in the service definition, but still $ARG1$ was not replaced with the value of ARG1. I'd prefer to define the Action URL in the service template, so that I won't have to create custom Action URLs for each service.

Is there any way to accomplish this?

Thank you!

Re: Using $ARG1$ macro in service Action URL

Posted: Fri Feb 15, 2013 11:16 am
by abrist
I tried to implement the use of an $ARGn$ in an action/notes URL the other night. My conclusion is that the ARG is not getting passed, but some other macros do. You may be able to use the $USERn$ macros, but those are limited and require you to configure them in a different file.

Re: Using $ARG1$ macro in service Action URL

Posted: Tue Feb 19, 2013 2:09 pm
by slinx
Thanks for your input. I guess this would need to be implemented as a new feature.

Re: Using $ARG1$ macro in service Action URL

Posted: Tue Feb 19, 2013 3:48 pm
by lmiltchev
I will be locking this topic now. Thanks for your post on the Nagios Ideas forum!