MSSQL monitoring problem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

MSSQL monitoring problem

Post by amintay »

Hello,

I'd like to share with you a problem I've encountered with nagiox XI when supervising MSSQL. If anyone can help me solve it, please let me know.
thank you in advance

ERROR: [run_check] CRITICAL: Could not connect to odbc:Driver=FreeTDS:Server=192.168.xx.xx\SQLSERVER:dbname=DataBase1:charset=UTF8 as nagxi (Exception: SQLSTATE[08001] SQLDriverConnect: 0 [FreeTDS][SQL Server]Unable to connect to data source)
User avatar
lgute
Posts: 117
Joined: Mon Apr 06, 2020 2:49 pm

Re: MSSQL monitoring problem

Post by lgute »

Hi @amintay, thanks for reaching out.

You can run the plugins from the command line, to make it easier to debug.

First make sure the check_ping plugin works.

Code: Select all

/usr/local/nagios/libexec/check_ping -H <sqlname.domain.local> -w 10,2% -c 20,5%

If you get output like this...

Code: Select all

CRITICAL - Host Unreachable (<sqlname.domain.local>)
There is a network/firewall/Windows firewall issue.

If you get output like this...

Code: Select all

PING OK - Packet loss = 0%, RTA = 0.08 ms|rta=0.078000ms;10.000000;20.000000;0.000000 pl=0%;2;5;0
Try running the MSSQL plugin.

Code: Select all

/usr/local/nagios/libexec/check_mssql_server.php -H <sqlhostname_or_ip> --checktype 'server' -U 'sa' -P '<your_password>' --perftype default -p 1433 --mode autoparamattempts --warning 100 --critical 200
If you get a response like this...

Code: Select all

ERROR: [run_check] CRITICAL: Could not connect to odbc:Driver=FreeTDS;Server=192.168.255.251;Port=1433;dbname=master;charset=UTF8 as xi_sql_user (Exception: SQLSTATE[08S01] SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist)
CRITICAL: Could not connect to odbc:Driver=FreeTDS;Server=192.168.255.251;Port=1433;dbname=master;charset=UTF8 as xi_sql_user (Exception: SQLSTATE[08S01] SQLDriverConnect: 20009 [FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist).
There is likely a SQLServer or Firewall configuration issue. For instance, is the TCP/IP protocol Enabled in the SQL Server Network Configuration | Protocols for MSSQLSERVER | TCP/IP?

This post may give you some ideas where to look for issues. viewtopic.php?p=345316#p345316

You should get a response like this, if the XI server can connect to your SQL Server.

Code: Select all

OK: Auto-Param Attempts/sec is 0.008914/sec|autoparam_attempts=0.008914;100;200;;
Please let us know if you have any other questions or concerns.

-Laura
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

Re: MSSQL monitoring problem

Post by amintay »

Hi Laura ,

thank you for your reply,

I ran the check_ping plugin and here's the result
Capture1.PNG
and I ran the MSSQL plugin and here's the result
Capture2.PNG
for firewall settings they are well added
Capture3.PNG
do you have any other ideas for solving this problem?

thank you.
You do not have the required permissions to view the files attached to this post.
kg2857
Posts: 237
Joined: Wed Apr 12, 2023 5:48 pm

Re: MSSQL monitoring problem

Post by kg2857 »

If you can ping the host and the port is open you have an odbc connection issue. Often a uname/pasword issue.
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

Re: MSSQL monitoring problem

Post by amintay »

hi,
Hello, I assure you that the user name and the password are correct.
User avatar
lgute
Posts: 117
Joined: Mon Apr 06, 2020 2:49 pm

Re: MSSQL monitoring problem

Post by lgute »

Hi @amintay,

How about enabling TCP/IP for SQL Server?

Enable TCP/IP in the SQL Server Configuration Manager
Image
Please let us know if you have any other questions or concerns.

-Laura
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

Re: MSSQL monitoring problem

Post by amintay »

Hi Laura,

it's enable
Capture1.PNG
do I need to configure my centos server (nagios XI)?

thank you.
You do not have the required permissions to view the files attached to this post.
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

Re: MSSQL monitoring problem

Post by amintay »

hello again laura,


I wanted to share something with you still about this MSSQL problem. I searched on the internet for a plugin to check mssql developed in python and I think it worked.while monitoring using config wizard does not work ?????
Capture1.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
lgute
Posts: 117
Joined: Mon Apr 06, 2020 2:49 pm

Re: MSSQL monitoring problem

Post by lgute »

Hi @amintay,

That is a very interesting result. It seems like something may not be setup correctly for the PHP plugin, since the Python one is working.
What version of CentOS are you using, what version of PHP, and what version of XI?

If you are willing to contact our support team directly, they could get to the bottom of this issue quickly. To contact support, open a ticket (case) at the Nagios Answer Hub.
Please let us know if you have any other questions or concerns.

-Laura
amintay
Posts: 16
Joined: Thu Dec 07, 2023 9:31 am

Re: MSSQL monitoring problem

Post by amintay »

Hi laura,

the centos version is CentOS Stream release 9
the php version is PHP 8.0.30 (cli) (built : Aug 3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
mssql version is 2017
version XI is full=5.11.3
I want to dig even deeper before opening a support ticket.

thanks.
Post Reply