getting error while connecting to DB
Posted: Fri Aug 07, 2020 12:01 pm
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.