How to test user macros from resource.cfg

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
uidaho
Posts: 89
Joined: Tue Feb 12, 2013 11:58 am

How to test user macros from resource.cfg

Post by uidaho »

I have added an entry in /usr/local/nagios/etc/resource.cfg as follows:
$USER9$=FindMe
and then I restarted nagios
/sbin/service nagios restart

To test, I am running
/usr/local/nagios/libexec/check_mssql -H <fqdn of host> -U Bob -P $USER9$ -p 1576

Running a packet trace on the host does not show "FindMe" being passed in with the username.

Conversely, if I run
/usr/local/nagios/libexec/check_mssql -H <fqdn of host> -U Bob -P FindMe -p 1576

The packet trace show the string "FindMe" where I would expect it.

How can I troubleshoot the USERn macros from resource.cfg?

Thank you

David Summers
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How to test user macros from resource.cfg

Post by scottwilkerson »

The macros get substituted in Nagios and are not available on the command line.

To test you can setup a test command with the following

Code: Select all

/bin/echo $USER9$
Then setup a service to use that command and see what is displayed in the service detail page.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
uidaho
Posts: 89
Joined: Tue Feb 12, 2013 11:58 am

Re: How to test user macros from resource.cfg

Post by uidaho »

Thank you Scott
Locked