getting error while connecting to DB
-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
getting error while connecting to DB
Hi Team,
We are trying to monitor DB availability on our onprem sql servers and getting below error when connecting from our onprem Nagios server:
/usr/local/nagios/libexec/check_mssql -H sqlhost --username NagiosSQL --password ****** --port 2058 --database SQLDB
CRITICAL: Could not connect to dblib:host=sqlhost:2058;dbname=SQLDBas NagiosSQL (Exception: SQLSTATE[01002] Adaptive Server connection failed (sqlhost) (severity 9)).
----------------------------------------------------------------
php plugins are installed:
rpm -qa | grep "php-pdo"
php-pdo-5.4.16-46.1.el7_7.x86_64
rpm -qa | grep "php-mssql"
php-mssql-5.4.16-9.el7.x86_64
----------------------------------------------------------------------
tds file contents are below:
vi /etc/freetds.conf
[global]
# TDS protocol version
tds version = auto
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# To reduce data sent from server for BLOBs (like TEXT or
# IMAGE) try setting 'text size' to a reasonable limit
; text size = 64512
# If you experience TLS handshake errors and are using openssl,
# try adjusting the cipher list (don't surround in double or single quotes)
# openssl ciphers = HIGH:!SSLv2:!aNULL:-DH
# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0
# A typical Microsoft server
[egServer73]
host = ntmachine.domain.com
port = 1433
tds version = 7.3
---------------------------------------------------------------------------------------------------------
We have same setup in cloud Nagios server and we are able to connect to cloud remote server DB availability. No issues in cloud
We tried also to connect from cloud Nagios server to our onprem remote sql serverr DB availability still there also we are getting error for onprem sql server DB connection.
Could you please help us in resolving the issue why we are getting the error.
We are trying to monitor DB availability on our onprem sql servers and getting below error when connecting from our onprem Nagios server:
/usr/local/nagios/libexec/check_mssql -H sqlhost --username NagiosSQL --password ****** --port 2058 --database SQLDB
CRITICAL: Could not connect to dblib:host=sqlhost:2058;dbname=SQLDBas NagiosSQL (Exception: SQLSTATE[01002] Adaptive Server connection failed (sqlhost) (severity 9)).
----------------------------------------------------------------
php plugins are installed:
rpm -qa | grep "php-pdo"
php-pdo-5.4.16-46.1.el7_7.x86_64
rpm -qa | grep "php-mssql"
php-mssql-5.4.16-9.el7.x86_64
----------------------------------------------------------------------
tds file contents are below:
vi /etc/freetds.conf
[global]
# TDS protocol version
tds version = auto
# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug flags = 0xffff
# Command and connection timeouts
; timeout = 10
; connect timeout = 10
# To reduce data sent from server for BLOBs (like TEXT or
# IMAGE) try setting 'text size' to a reasonable limit
; text size = 64512
# If you experience TLS handshake errors and are using openssl,
# try adjusting the cipher list (don't surround in double or single quotes)
# openssl ciphers = HIGH:!SSLv2:!aNULL:-DH
# A typical Sybase server
[egServer50]
host = symachine.domain.com
port = 5000
tds version = 5.0
# A typical Microsoft server
[egServer73]
host = ntmachine.domain.com
port = 1433
tds version = 7.3
---------------------------------------------------------------------------------------------------------
We have same setup in cloud Nagios server and we are able to connect to cloud remote server DB availability. No issues in cloud
We tried also to connect from cloud Nagios server to our onprem remote sql serverr DB availability still there also we are getting error for onprem sql server DB connection.
Could you please help us in resolving the issue why we are getting the error.
Re: getting error while connecting to DB
Is there a special character in your password?
You could also try putting the username in quotes. Please take a look at the following document for more information on what can cause this error.
Adaptive Server Connection Failed
You could also try putting the username in quotes. Please take a look at the following document for more information on what can cause this error.
Adaptive Server Connection Failed
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
Re: getting error while connecting to DB
Password we are using is a simple one no special characters in it.
We tried using single quotes to username still had no luck to it.
But We are having custom ports to monitor DBs
Could you please help us how to resolve the issue.
We tried using single quotes to username still had no luck to it.
But We are having custom ports to monitor DBs
Could you please help us how to resolve the issue.
Re: getting error while connecting to DB
What version of the plugin are you using?
Apparently there was a bug in a previous version of this plugin that would cause it to use the default port, even when the option was specifying otherwise. If you are using a version 1.6.1 or lower, you may want to update.See how the server name is not shown. The problem here is that the check_mssql plugin has a bug, it is not using the custom TCP port you defined when running the wizard (instead of the default 1433). This problem has been resolved in version 1.6.1 of the MSSQL Query wizard. To update to the latest version of the wizard navigate to Admin > System Extensions > Manage Config Wizards. On this page you can check for updates and install the latest available version.
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
Re: getting error while connecting to DB
Hi Team,
Plugin we are using is
check_mssql
and version is
Version 0.8.5 - 2019/010/18 # - Changed the output message depending on the querywarning and querycritical thresholds.
source: https://exchange.nagios.org/directory/P ... ql/details
Please provide us any alternate plugin if this plugin is of no use.
Plugin we are using is
check_mssql
and version is
Version 0.8.5 - 2019/010/18 # - Changed the output message depending on the querywarning and querycritical thresholds.
source: https://exchange.nagios.org/directory/P ... ql/details
Please provide us any alternate plugin if this plugin is of no use.
Re: getting error while connecting to DB
Yes, so in that case you should update. Navigate to the Admin section of XI using the top bar > click Manage Config Wizards under System Extensions on the left > and click Check for Updates then Install Updates.
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
Re: getting error while connecting to DB
Hi team,
Wizard version we are using is 1.6.7 Please find attached image.
Still getting the same error mentioned. Could you please help us how to resolve this error further.
Wizard version we are using is 1.6.7 Please find attached image.
Still getting the same error mentioned. Could you please help us how to resolve this error further.
You do not have the required permissions to view the files attached to this post.
Re: getting error while connecting to DB
Dang! I thought that was it.
What result do you get if you scan the MsSQL server with nmap from the XI machine?
You can usually use the -h option to see the help page associated with the plugin. Please take a look at this to double check that all necessary options are present, and the correct values are being passed to them.
It never hurts to send ( PM ) us a profile either! We can find lots of information about your system in there. You can download the profile by navigating to System Profile under System Config on the left pane > and clicking the Download Profile button on that page
What result do you get if you scan the MsSQL server with nmap from the XI machine?
Code: Select all
nmap -p 2058 <host IP>Code: Select all
/usr/local/nagios/libexec/check_mssql -hAs 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
vinayvemula
- Posts: 18
- Joined: Mon Jun 03, 2019 2:09 am
Re: getting error while connecting to DB
Below is the output when ran nmap from nagios xi machine:
nmap -p 2058 sqlserver
Starting Nmap 6.47 ( http://nmap.org ) at 2020-08-19 19:14 CEST
Nmap scan report for sqlserver
Host is up (0.0010s latency).
rDNS record for sqlserveripaddress: sqlserver
PORT STATE SERVICE
2058/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
nmap -p 2058 sqlserver
Starting Nmap 6.47 ( http://nmap.org ) at 2020-08-19 19:14 CEST
Nmap scan report for sqlserver
Host is up (0.0010s latency).
rDNS record for sqlserveripaddress: sqlserver
PORT STATE SERVICE
2058/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds
Re: getting error while connecting to DB
After doing some more digging on what that error message is telling us, I found several sources saying that the problem could be related to the TDS version and/or configuration.Adaptive Server connection failed
(severity 9)
The configuration file for TDS is likely in the following location. Uncomment out the line specifying the version.
Code: Select all
/etc/freetds/freetds.confCode: Select all
Port = 2058As 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!