We are using check_nt to check Dynamics active sessions and open connections. But the problem is that microsoft decided that it was a good idea to use # in the performance counter names. Is there a way i can escape these # characters? When i use the check on the command line it returns a valid number, but when i confiugre it in nagios xi i get a 0
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l "\\Microsoft Dynamics NAV(nst90test)\# Active sessions
check_nt with special character (#)
Re: check_nt with special character (#)
One thing to try is to use single quotes around the counter name and remove any escaping so when Nagios runs the check, it will use literal value between the single quotes without it trying to escape it further and that should work for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nt with special character (#)
Ok tnx!! I will try as you suggested. Sounds good!
Re: check_nt with special character (#)
Let us know how it works out for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nt with special character (#)
sorry for the extreme late reply but the customer i have to fix this for didnt invite me back until now.
I just tried again. The single quote works, but only if i create a custom check for the command. So i create a command with the following line:
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l '\Microsoft Dynamics NAV(nst90testmobosp)\# Active sessions'
When i do a test command from within the webinterface, i get a result of 7 with is correct. But when i let nagios check it for itself like a normal check it returns 0.
EDIT:
By the way, when i execute the command from the command line it also returns the correct value
I just tried again. The single quote works, but only if i create a custom check for the command. So i create a command with the following line:
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l '\Microsoft Dynamics NAV(nst90testmobosp)\# Active sessions'
When i do a test command from within the webinterface, i get a result of 7 with is correct. But when i let nagios check it for itself like a normal check it returns 0.
EDIT:
By the way, when i execute the command from the command line it also returns the correct value
Re: check_nt with special character (#)
Hold on. Just updated Nagios XI to the latest version. Restarted the check, and i now have a correct value. I will check if al is working now and report back 
Re: check_nt with special character (#)
The update to 5.4.4 (from 5.2) fixed this issue. I have now working commands in Nagios XI. The command now just contains:
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l $ARG1$
And $ARG1$ =
'\Microsoft Dynamics NAV(nst90testmobspa)\# Active sessions'
And it doesnt seem to matter if you use single or dubble quotes.
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v COUNTER -l $ARG1$
And $ARG1$ =
'\Microsoft Dynamics NAV(nst90testmobspa)\# Active sessions'
And it doesnt seem to matter if you use single or dubble quotes.
Re: check_nt with special character (#)
There was a bug fix in XI 5.4.3 for the Test Check button so that probably solved your issue.
If you don't have any other questions, shall I close and mark the post as solved?
If you don't have any other questions, shall I close and mark the post as solved?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: check_nt with special character (#)
Yes, it can be marked as solved! Works like a charm now.