Question

MSSQL Monitoring with domain account

  • 3 January 2023
  • 3 replies
  • 609 views

Badge +2

Hello

 

I try to configure the monitoring of an MS SQL 2014 always on cluster
I become crazy i don’t understand why i cannot connect using a domain account : 

 

# /usr/lib/centreon/plugins//centreon_mssql.pl --plugin database::mssql::plugin --hostname <clusterFQDN> --port 1433 --username <DOMAIN>\\<USER> --password <PASSWORD> --verbose --mode='connection-time'


CRITICAL: Cannot connect: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
Server message number=18452 severity=14 state=1 line=1 server=WUNIDBKLIF4 text=Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)
Server , database
Message String: Adaptive Server connection failed
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)
Server , database
Message String: Adaptive Server connection failed
 

but from the same pooler i am able to connect without any problem with tsql 

 

# tsql -H <clusterFQDN> -p 1433 -U '<DOMAIN>\<USER>' -P '<PASSWORD>' -v -ot -ov      

                         locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> exit

#

 

my freetds.conf file : 

 

[global]
        # TDS protocol version
tds version = 8.0
      
        # 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
use ntlmv2 = yes #Added for testing

 

 

I’m running centreon 22.04

Does anyone have an idea why ?


 


3 replies

Userlevel 4
Badge +13

👋

 

@websylv can you confirm that you have “ freetds perl-DBD-Sybase unixODBC ” installed. TSQL doesn’t use the client libraries but libtds/tdslib ( https://www.freetds.org/faq.html )

 

How should I choose among DB-Library, CT-Library, and ODBC?

FreeTDS offers three client libraries and one internal one (libtds). We generally encourage people to use one of the client libraries, and discourage writing to libtds, because the latter is evolving, more subject to change, less well documented, and harder to use. In choosing which client API to write to, you might want to peruse our brief discussion.

 

You might want to try with a specific “datasource”

 

--datasource='ODBC:DRIVER={FreeTDS};SERVER=x.x.x.x;PORT=xxx ;TDS_Version=8.0;UseNTLMv2=Yes'

 

🤞

Badge +2

Hello

Yes all is installed : 

# yum install freetds perl-DBD-Sybase unixODBC
Last metadata expiration check: 2:38:43 ago on Wed 04 Jan 2023 04:40:39 AM CET.
Package freetds-1.3.3-1.el8.x86_64 is already installed.
Package perl-DBD-Sybase-1.16-1.el8.x86_64 is already installed.
Package unixODBC-2.3.7-1.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

 

To test with datasouce i had to install  perl-DBD-ODBC 

And it work : 

# /usr/lib/centreon/plugins//centreon_mssql.pl --plugin database::mssql::plugin --username <domain>\\<username> --password <password> --verbose --mode='connection-time' --datasource='ODBC:DRIVER={FreeTDS};SERVER=<clusterFQDN>;PORT=1433 ;TDS_Version=8.0;UseNTLMv2=Yes'

 OK: Connection established in 0.018s. | 'connection_time'=18ms;;;0;

 

I’m am a new user of centreon and to be honnest i don’t know where to change the command line in all the services since this come with pluginspack. What is the best way ? 
 

 

Userlevel 4
Badge +13

The following link should guide you on how the commands get constructed and executed.

https://docs.centreon.com/docs/monitoring/basic-objects/commands/

Also, depending on your setup you might consider duplicating the command to be able to test.

🤞

Reply