Page 1 of 1

ERROR: [run_check] CRITICAL: Could not connect to dblib

Posted: Tue Apr 20, 2021 3:16 am
by nagiosxi-admins
Hi Team,

We are getting below error for our database connection for all metrics when we are trying to configure.
I am following same steps provided in the Nagios configuration document and I am attaching the same with this.
Here is the error:
ERROR: [run_check] CRITICAL: Could not connect to dblib:host=hostname.xilinx.com\hostaname:dbname=master:charset=UTF8 as xlnx\sa (Exception: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (hostname.xilinx.com) (severity 9))

Thanks,
Mayank

Re: ERROR: [run_check] CRITICAL: Could not connect to dblib

Posted: Tue Apr 20, 2021 12:18 pm
by dchurch
This error crops up if you go thru the wizard and don't select the exact version of MSSQL that you're connecting to. The protocols are way different between versions.

Re: ERROR: [run_check] CRITICAL: Could not connect to dblib

Posted: Mon May 10, 2021 12:10 pm
by nagiosxi-admins
Hi,

I checked and found we are using correct version but still not getting through.

Thanks,
Mayank

Re: ERROR: [run_check] CRITICAL: Could not connect to dblib

Posted: Tue May 11, 2021 12:32 pm
by ssax
What XI version are you running?

Please go to Admin > Manage Config Wizards and click the Check for Updates button, install any MSSQL updates.

What is the output of these commands from the XI server?
- Set X.X.X.X to the IP or DNS name of the DB server
- Set XXXX to the port it's using (1433 is the default port)
- Set X.X.X.X, yourusername, and yourpassword on the last command

Code: Select all

nmap -Pn -p XXXX X.X.X.X
rpm -qa | grep php
uname -a
cat /etc/*release
/usr/local/nagios/libexec/check_mssql -H X.X.X.X --username 'yourusername' --password 'yourpassword' --database 'master' --port 1433 --query 'SELECT+COUNT%28%2A%29+FROM+sys.sysperfinfo' --decode --warning '50' --critical '200' --querywarning '50' --querycritical '200' --result 'Expected result'
See here as well:

https://support.nagios.com/kb/article/n ... d-735.html