Page 1 of 1

Problems monitoring MSSQL Data Base

Posted: Thu Sep 23, 2021 6:01 pm
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

Re: Problems monitoring MSSQL Data Base

Posted: Fri Sep 24, 2021 12:30 pm
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.

Re: Problems monitoring MSSQL Data Base

Posted: Fri Sep 24, 2021 5:38 pm
by SEDITEC
How about add single quotes in password but now I get this error "(No output returned from plugin)"

Re: Problems monitoring MSSQL Data Base

Posted: Mon Sep 27, 2021 3:31 pm
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.

Re: Problems monitoring MSSQL Data Base

Posted: Thu Sep 30, 2021 10:48 am
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

Re: Problems monitoring MSSQL Data Base

Posted: Fri Oct 01, 2021 2:00 pm
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

Re: Problems monitoring MSSQL Data Base

Posted: Wed Oct 06, 2021 11:13 am
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]"

Re: Problems monitoring MSSQL Data Base

Posted: Thu Oct 07, 2021 11:24 am
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