rapid response url help

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: rapid response url help

Post by scottwilkerson »

You could add a $USERn$ macro in the resources.cfg on each of the instances and then reference that.

e.g. add to /usr/local/nagios/etc/resource.cfg

Code: Select all

$USER20$=http://prdnagxi01.example.net/nagiosxi/
Then reference $USER20$ in commands
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jenstar13
Posts: 174
Joined: Wed May 11, 2016 7:48 am

Re: rapid response url help

Post by jenstar13 »

it does not look like the standard macros work in this

Code: Select all

#Link to HOST test
$USER21$=http://prdnagxi01.example.net/nagios/cgi-bin/extinfo.cgi?type=1&host=$HOSTNAME$
Gives
http://prdprdnagxi01.example.net/nagios ... xample.net
&host should be &host=prdftp01.example.net

Code: Select all

#Link to service test
$USER20$=http://prdnagxi01.example.net/nagios/cgi-bin/extinfo.cgi?type=2&host=$HOSTNAME$&service=$SERVICEDESC$
Same for this it replaces HOSTNAME with the Nagios server, and leaves service blank
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: rapid response url help

Post by scottwilkerson »

I was just suggesting adding the user macro as just the base URL

Code: Select all

$USER20$=http://prdnagxi01.example.net/nagiosxi/
and then building the whole URL you are looking for either in your command or in your script.

You can't put a $HOSTNAME$ or $SERVICEDESC$ in the resources.cfg as it isn't populated yet, the macros populate when it know what host/service it is running for.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked