Using $ARG1$ macro in service Action URL

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
slinx
Posts: 3
Joined: Thu Feb 14, 2013 9:23 am

Using $ARG1$ macro in service Action URL

Post 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!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Using $ARG1$ macro in service Action URL

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
slinx
Posts: 3
Joined: Thu Feb 14, 2013 9:23 am

Re: Using $ARG1$ macro in service Action URL

Post by slinx »

Thanks for your input. I guess this would need to be implemented as a new feature.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Using $ARG1$ macro in service Action URL

Post by lmiltchev »

I will be locking this topic now. Thanks for your post on the Nagios Ideas forum!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked