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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiosxi-admins
Posts: 17
Joined: Wed Mar 10, 2021 7:09 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

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

Post 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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
nagiosxi-admins
Posts: 17
Joined: Wed Mar 10, 2021 7:09 am

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

Post by nagiosxi-admins »

Hi,

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

Thanks,
Mayank
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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
Locked