Page 1 of 1

MSSQL server monitoring issue

Posted: Thu Jun 06, 2013 9:54 pm
by ravish78
Hi Team,
We are getting some issue with MSSQLSERVER monitoring.

Manual checks are working fine but GUI is not working .

-bash-3.2$ ./check_nt -H usa0300as937 -p 12489 -v SERVICESTATE -l MSSQL\$USA0300AV1576_7
OK: All services are in their appropriate state.


IF I use attached format in GUI .It is working fine but command line is giving error.Can you please help with this.

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 9:24 am
by ravish78
Any suggestions on this

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 9:28 am
by abrist
What error do you receive from the gui for the check?

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 10:59 am
by ravish78
Below is the Error we are seeing in GUI

COMMAND: /usr/local/nagios/libexec/check_nt -H usa0300as937 -p 12489 -v SERVICESTATE -l MSSQL\\\\\$USA0300AV1576_7
OUTPUT: MSSQL\\$USA0300AV1576_7: Error

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 1:54 pm
by lmiltchev
Replace "-l MSSQL\\\\\$USA0300AV1576_7" in the $ARG3$ field with "-l MSSQL\$USA0300AV1576_7". No-quotes should work, but if it doesn't - try single or double quotes. Let me know if this helped.

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 2:48 pm
by ravish78
Command used in console is working fine
-bash-3.2$ /usr/local/nagios/libexec/check_nt -H usa0300as937 -p 12489 -v SERVICESTATE -l MSSQL\$USA0300AV1576_7
OK: All services are in their appropriate state.


Command used in GUI

Command view
$USER1$/check_nt -H $HOSTADDRESS$ -p 12489 -v SERVICESTATE -l $ARG1$

$USER1$ is /usr/local/nagios/libexec
$HOSTADDRESS$ is taken as usa0300as937
ARG1 value is given as MSSQL\$USA0300AV1576_7 it is without quotes

Error we saw is when executing test command
COMMAND: /usr/local/nagios/libexec/check_nt -H usa0300as937 -p 12489 -v SERVICESTATE -l MSSQL\\\\\$USA0300AV1576_7
OUTPUT: MSSQL\\$USA0300AV1576_7: Error

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 2:53 pm
by sreinhardt
I would highly suggest against using the test check command when testing things that need to be escaped. PHP has some very odd sanatization that happens, that is not directly needed in an actual nagios check and can cause false issue. I would suggest disabling notifications for that check, and allowing nagios to execute it as lmiltchev has defined for you as a normal service check.

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 3:15 pm
by ravish78
Can you clearly explain what needs to be done.Test check command is giving error even if we are using correct variables.

Re: MSSQL server monitoring issue

Posted: Fri Jun 07, 2013 3:42 pm
by slansing
The best way to test how nagios perceives the command, use the service details page from the Home menu to test the check.. simply navigate to the service details page of this service, if changes need to be made, either reconfigure the service, or go back into the ccm and alter the service, then apply config, hope this helps!

Re: MSSQL server monitoring issue

Posted: Mon Jun 10, 2013 1:37 pm
by ravish78
This worked ...
Thank you for your suggestion. You an close this.