Hi all, I am experiencing a weird issue with my 5.2.7 XI instance.
I am trying to define some custom $USERn$ macros in resource.cfg.
They are defined like this:
$USER10$=testaccount
$USER11$=testpassword
I am trying to use those $USERn$ macros in a Service check in the CCM - I am passing them through the $ARG1$ and $ARG2$ options. The dollar-signs are being escaped, and the variable not interpreted when I run "Test Check Command"
A screen shot of the config is attached.
Output from "Test Check Command" is as follows:
COMMAND: /usr/local/nagios/libexec/check_mssql_server.py -H testhost.testdomain.com -U \$USER10\$ -P \$USER11\$
OUTPUT: (18456, "Login failed for user '$USER10$'.DB-Lib error message 20018, severity 14:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (testhost.testdomain:1433)\n")
This doesn't seem to be the way things should work. Is there a place I can start looking to figure out why this is happening?
Additional info:
The $USER1$ variable is correctly passed as an ARG - even when passed through $ARGn$ in the CCM.
There are no strange characters used in the resource.cfg. There are no other USER macros defined, other than the XI defaults (USER1, USER7 and USER8, and the two mentioned here). $USER1$ is the only one that gets interpreted.
I have another 5.3.3 XI instance, and everything works great there. I understand there were a number of changes along the way, but I dont see any bugfixes regarding this in the XI 5 release notes... so I am not confident this is a bug; rather some sort of issue with my instance.
I'd really like to get this 5.2.7 instance working until I can get it upgraded.
FWIW, the only custom variable set in the nagios.cfg is "enable_environment_macros=1".
Thanks,
-marc
USER macro not being interpreted.
USER macro not being interpreted.
You do not have the required permissions to view the files attached to this post.
Last edited by yo_marc on Thu Dec 08, 2016 10:21 am, edited 1 time in total.
Re: USER macro not being interpreted.
Another quick note regarding 'enable_environment_macros=1"
I set that in the working 5.3.3 instance (default is/was 0)-- made no difference to its correct handling of the USER macros.
I set that in the working 5.3.3 instance (default is/was 0)-- made no difference to its correct handling of the USER macros.
Re: USER macro not being interpreted.
I think this can be considered 'resolved'.
I went a step further and applied my config, even though the "Test Check Command" was not running the Service check correctly.
The check does indeed work as needed.
I went a step further and applied my config, even though the "Test Check Command" was not running the Service check correctly.
The check does indeed work as needed.
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: USER macro not being interpreted.
The test check isn't always accurate in variable expansion.
Locking this thread, but for posterity:
https://assets.nagios.com/downloads/nag ... ponent.pdf
Locking this thread, but for posterity:
https://assets.nagios.com/downloads/nag ... ponent.pdf
Previous Nagios employee