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
How to test user macros from resource.cfg
-
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
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
Then setup a service to use that command and see what is displayed in the service detail page.
To test you can setup a test command with the following
Code: Select all
/bin/echo $USER9$Re: How to test user macros from resource.cfg
Thank you Scott