Skip to main content

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 !

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


Hi,

 

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

 

Thanks,


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.


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!

 


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 oserver] I added to try)

 

Thanks

Best Regards,


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


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,


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. 


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