Page 1 of 1

How to test user macros from resource.cfg

Posted: Tue Jun 11, 2013 6:50 pm
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

Re: How to test user macros from resource.cfg

Posted: Wed Jun 12, 2013 7:21 am
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.

Re: How to test user macros from resource.cfg

Posted: Wed Jun 12, 2013 10:20 am
by uidaho
Thank you Scott