Problems monitoring MSSQL Data Base

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
SEDITEC
Posts: 7
Joined: Fri Sep 17, 2021 12:19 pm

Problems monitoring MSSQL Data Base

Post by SEDITEC »

Hello, I am trying to monitor an MSSQL database, in the wizard I add the corresponding data, but when I create the host, the services mark me Warning and show me this error:
(No output on stdout) stderr: /bin/sh: -c: línea 0: EOF inesperado mientras se buscaba un `'' coincidente
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Problems monitoring MSSQL Data Base

Post by ssax »

It likely has to do with special characters in the password. Make sure the password is surrounded in single-quotes on the service.

Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button.
SEDITEC
Posts: 7
Joined: Fri Sep 17, 2021 12:19 pm

Re: Problems monitoring MSSQL Data Base

Post by SEDITEC »

How about add single quotes in password but now I get this error "(No output returned from plugin)"
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Problems monitoring MSSQL Data Base

Post by ssax »

What is the full command with arguments that the check is running? (you can sanitize the user/password)

If you need help, please PM me a copy of your profile.zip from Admin > System Profile by clicking the Download Profile button and let me know the name of the host/service in question.
SEDITEC
Posts: 7
Joined: Fri Sep 17, 2021 12:19 pm

Re: Problems monitoring MSSQL Data Base

Post by SEDITEC »

I share the command to check the connection time:

$ USER1 $ / check_mssql_server.php -H $ HOSTADDRESS $ $ ARG1 $

where ARG1 is --checktype 'database' -U 'user' -P ''password
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Problems monitoring MSSQL Data Base

Post by benjaminsmith »

Hi,

Can you run the full command from the CLI and add the -v option for verbose output and post it to the thread for us to review. Here's a sample command that works from my test system:

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.php -H 192.168.x.x 2 --checktype 'database' -U 'administrator' -P 'password' --instancename 'master' --perftype default -p 1433 --mode datasize --warning 10000 --critical 100000 -v
The following knowledgebase article has instructions for retrieving the full check command.

Nagios XI - How To Test Check Commands From The Command-line

Also, a system profile would be very helpful.

To Download a System Profile
To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button

Thanks,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
SEDITEC
Posts: 7
Joined: Fri Sep 17, 2021 12:19 pm

Re: Problems monitoring MSSQL Data Base

Post by SEDITEC »

Hi, what I get is the following:

Code: Select all

[[email protected] ~]$ /usr/local/nagios/libexec/check_mssql_server.php -H 172.28.1.16 --checktype 'database' -U 'user ' -P ''password

***ERROR***:

Command line parsing error: Required variable "warning" not present.



check_mssql_database 2.0.3 - Copyright 2021 Nagios Enterprises, LLC.
Portions Copyright others (see source code).

Usage: /usr/local/nagios/libexec/check_mssql_server.php <options>

usage = "usage: %prog --checktype type -H hostname -U username -P password --mode testname
-w warning -c critical [-i instancename] [--perftype type] [--custom 'args']
[-v | -vv | -vvv | --verbose --complex]"
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Problems monitoring MSSQL Data Base

Post by benjaminsmith »

Hi,

Thanks for trying that, the command is missing required arguments so it won't complete.
***ERROR***:

Command line parsing error: Required variable "warning" not present.
Try adding a warning option or use the sample command provided in the last post.

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked