Escaping Brackets in check_nt ????

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
sikainfo
Posts: 105
Joined: Thu Mar 29, 2012 3:26 am

Escaping Brackets in check_nt ????

Post by sikainfo »

Hi there,
have a little problem with a check for a service on a Windows Server.
The windows Service Name and Display Name is Lotus Domino Server (Dnotesdata)

Btw: this is copied from the service properties

In Nagios Core 3.3.1 (SUSE Linux) it works fine with this command:
/usr/local/nagios/libexec/check_nt -H xxxxx -p 12489 -v SERVICESTATE -d SHOWALL -l 'Lotus Domino Server (Dnotesdata)'

In NagiosXI 2012R1.2 (RHEL 6.3) it cannot find the Service!
with the following errormessage:
OUTPUT: Lotus Domino Server \(Dnotesdata\): Error

Can you give me a tip to fix that?

THX Andy
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Escaping Brackets in check_nt ????

Post by lmiltchev »

Testing a command doesn't always work in the CCM (vs actually running the check in the command line), because of "(", ")", etc. We are working on fixing that. However, your check should still run fine. For example, I setup a service "Encrypting File System (EFS)", and works just fine, even though, the "Test Check Command" in the CCM fails. See bellow:

My command:

Code: Select all

 /usr/local/nagios/libexec/check_nt -H <IP> -s "password" -p 12489 -v SERVICESTATE -l 'Encrypting File System (EFS)' -d SHOWALL
In the web interface:
check.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
sikainfo
Posts: 105
Joined: Thu Mar 29, 2012 3:26 am

Re: Escaping Brackets in check_nt ????

Post by sikainfo »

Hello lmiltchev,

as you see below, this command doesn't work like yours. Don't know why :? ?

see trought CCM Test command:
COMMAND: /usr/local/nagios/libexec/check_nt -H xxxxx -p 12489 -v SERVICESTATE -d SHOWALL -l 'Lotus Domino Server \(Dnotesdata\)'
OUTPUT: Lotus Domino Server \(Dnotesdata\): Error

See trought NagiosXI interface:
Errormessage.jpg
and now running on the Unix Pompt:

[root@chsismon1 ~]# /usr/local/nagios/libexec/check_nt -H xxxx -p 12489 -v SERVICESTATE -d SHOWALL -l 'Lotus Domino Server (Dnotesdata)'
Lotus Domino Server (Dnotesdata): Started

Here it works !!!! so what's going on here ?????

Andy
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Escaping Brackets in check_nt ????

Post by lmiltchev »

This is strange... Click on the "Lotus Domino Server" service from the Home Page->Service Detail. Then click on Configure->Re-configure this service, copy and paste the command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
sikainfo
Posts: 105
Joined: Thu Mar 29, 2012 3:26 am

Re: Escaping Brackets in check_nt ????

Post by sikainfo »

cannot copy and paste because of this message:

This service appears to make use of an advanced configuration. Use the Nagios Core Config Manager to modify the settings for this service.

greets Andy
User avatar
sikainfo
Posts: 105
Joined: Thu Mar 29, 2012 3:26 am

Re: Escaping Brackets in check_nt ????

Post by sikainfo »

this is how it is configured

2012-11-29 17-54-20_Nagios XI - Configuration.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Escaping Brackets in check_nt ????

Post by lmiltchev »

Can you check if by chance you have an "extra" space between "Server" and "Dnotesdata" in $ARG2$? The name must match exactly, so that the check works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
sikainfo
Posts: 105
Joined: Thu Mar 29, 2012 3:26 am

Re: Escaping Brackets in check_nt ????

Post by sikainfo »

Cool Tip
Thanks a lot, I do not understand how this space came in, because i copied the string from the service properties in windows ????
But it works now and that's cool. Thank you again

Andy
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Escaping Brackets in check_nt ????

Post by lmiltchev »

Great! I'm glad I could help! :D
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked