Page 1 of 1

Escaping Brackets in check_nt ????

Posted: Wed Nov 28, 2012 12:11 pm
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

Re: Escaping Brackets in check_nt ????

Posted: Wed Nov 28, 2012 12:43 pm
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

Re: Escaping Brackets in check_nt ????

Posted: Thu Nov 29, 2012 10:34 am
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

Re: Escaping Brackets in check_nt ????

Posted: Thu Nov 29, 2012 10:45 am
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.

Re: Escaping Brackets in check_nt ????

Posted: Thu Nov 29, 2012 11:53 am
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

Re: Escaping Brackets in check_nt ????

Posted: Thu Nov 29, 2012 11:56 am
by sikainfo
this is how it is configured

2012-11-29 17-54-20_Nagios XI - Configuration.jpg

Re: Escaping Brackets in check_nt ????

Posted: Thu Nov 29, 2012 1:03 pm
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.

Re: Escaping Brackets in check_nt ????

Posted: Fri Nov 30, 2012 3:05 am
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

Re: Escaping Brackets in check_nt ????

Posted: Fri Nov 30, 2012 10:18 am
by lmiltchev
Great! I'm glad I could help! :D