Solved

Centreon MSSQL plugin - Azure MSSQL instance

  • 1 February 2022
  • 9 replies
  • 586 views

Badge +1

Hi all,

 

We recently got an Azure MSSQL instance, and need to monitor it, but unfortunately it isn’t as smooth right now as “on-premise” MSSQL instances:

Wether I’m using the user@server that usually Azure instances require or not:

/usr/lib/centreon/plugins//centreon_mssql.pl --plugin database::mssql::plugin --hostname 'XXXXXXX.database.windows.net' --username 'Centreon@XXXXXXX.database.windows.net' --password 'XXXXXXX' --mode='connection-time'  --warning=1000 --critical=5000

CRITICAL: Cannot connect: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server , database
Message String: Unable to connect: Adaptive Server is unavailable or does not exist |

 

The host exists and can be resolved, and the “Centreon” user is indeed created with a capital C.

 

However a simple tsql command succeeds :

-bash-4.2$ tsql -H XXXXXXX.database.windows.net -U Centreon@XXXXXXX.database.windows.net -P 'XXXXXXX' -p 1433
>locale is "en_US.UTF-8"
>locale charset is "UTF-8"
>using default charset "UTF-8"
>

 

I’m not sure what I’m missing in the syntax for the plugin.

If you have experience connecting to Azure MSSQL instances with this plugin I’d need your insight.

 

Thanks !

icon

Best answer by gherisse 4 March 2022, 08:53

View original

9 replies

Userlevel 1
Badge +2

hello sir did you resolve the problem cause i’m in the same situation

Badge +1

Hi,

 

No I’ve still not managed to connect to that Azure SQL database with the plugin .

 

Thanks,

Userlevel 1
Badge +2

hi again, i didn’t resolve it and i just switch to zabbix i found it easy and very popular, thanks sir have and have a great time.

Userlevel 6
Badge +19

Hi @gherisse 

Could you share your driver and RPM versions please? 

You can use these commands: 

./tsql -C

rpm -qa | grep freetds

grep version /etc/freetds.conf

and paste the result here. 

Thanks!

 

Badge +1

Hi @sims24 ,

 

Of course here are the results:

tsql -C
Compile-time settings (established with the "configure" script)
                            Version: freetds v1.3.3
             freetds.conf directory: /etc
     MS db-lib source compatibility: yes
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: auto
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: yes
                            OpenSSL: no
                             GnuTLS: yes
                               MARS: yes
 

rpm -qa | grep freetds
freetds-libs-1.3.3-1.el7.x86_64
freetds-1.3.3-1.el7.x86_64

 

grep version  /etc/freetds.conf
        # TDS protocol version
        tds version = 8.0
        tds version = 5.0
    tds version = 8.0 ← (that’s the [server] I added to try)

 

Thanks

Best Regards,

Userlevel 6
Badge +19

Ok, what I could offer is a remote session with webex to better understand what fails here. 

Please don’t define anything/any server definition in /etc/freetds.conf unless the global tds version = 8.0 directive. 

 

Thanks

Badge +1

Thank you very much for that, I’ll be available from 10:30 CET tomorrow. Not sure how I’m supposed to send you an invite however :)

 

Best Regards,

Userlevel 6
Badge +19

I’ll find you ;) 

Not sure it’s the best answer … yet. But I’ll post here what we have found during the webex, I’ll send you a meeting request soon. 

Badge +1

Just to update everyone, we had to opt for the ODBC mode, with a --datasource option to force NTLMv2, using the DBI connection string syntax. 

 

In our example, it will look like this:  --datasource='ODBC:DRIVER={FreeTDS}\;SERVER=XXXXX.database.windows.net\;PORT=1433\;TDS_Version=auto\;UseNTLMv2=Yes'

 

Thanks again to Simon and Quentin for the help !

Reply