MSSQL server monitoring issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

MSSQL server monitoring issue

Post 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.
You do not have the required permissions to view the files attached to this post.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: MSSQL server monitoring issue

Post by ravish78 »

Any suggestions on this
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: MSSQL server monitoring issue

Post by abrist »

What error do you receive from the gui for the check?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: MSSQL server monitoring issue

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: MSSQL server monitoring issue

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: MSSQL server monitoring issue

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: MSSQL server monitoring issue

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: MSSQL server monitoring issue

Post by ravish78 »

Can you clearly explain what needs to be done.Test check command is giving error even if we are using correct variables.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: MSSQL server monitoring issue

Post 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!
ravish78
Posts: 269
Joined: Wed Mar 14, 2012 9:50 am

Re: MSSQL server monitoring issue

Post by ravish78 »

This worked ...
Thank you for your suggestion. You an close this.
Locked