Hi Everyone, I am unsure if this is a NagiosQL or Nagios Core query. Apologies if I am in the wrong spot.
I wish to monitor the following NT service: AOS50$01. I need to escape the "$".
From the Nagios console prompt check_nt -H hostipaddress -p hostport -v SERVICESTATE -l AOS50\$01 works fine. I have escaped the "$" using backslash. check_nt -H hostipaddress -p hostport -v SERVICESTATE -l 'AOS50$01' also works.
In NagiosQL none of the above escape sequences work. However, escaping the "$" with a $ does, eg: AOS50$$01. I know this because with Nagios debugging enabled, Nagios logs this:
[1282019438.072002] [2048.1] [pid=10194] Processing: '$USER1$/check_nt -H $HOSTADDRESS$ -p 51248 -v SERVICESTATE -l $ARG1$'
[1282019438.072019] [2048.1] [pid=10194] Done. Final output: '/usr/local/nagios/libexec/check_nt -H hostipaddress -p hostport -v SERVICESTATE -l AOS50$01'
Nagios appears to be parsing/executing the correct command. However, the Nagios web console (Status Information column) continues to show this --> "AOS50sh1: Unknown". It doesn't appear to be escaping the "$".
I am not sure where the problem lies or how to rectify. It seems NagiosQL is doing the 'right' thing because Nagios has parsed the check_nt command correctly as per the debugging output above. But something in b/w the parsing and execution is not right.
If anyone has any ideas please let me know. Cheers!
Escape Sequence for check_nt
Re: Escape Sequence for check_nt
It appears the answer to my problem is to enclose the NT service in single quotes and double the "$" sign, so AOS50$01 becomes 'AOS50$$01'.