Hi, I am trying to a database using MSSQL Wizard. Followed the instructions carefully.
However, in the end I received an Error Message:
ERROR: [run_check] CRITICAL: Could not connect to odbc:Driver=FreeTDS:Server=172.17.117.32:Port=1433:dbname=CensorshipDB:charset=UTF8 as nagios (Exception: SQLSTATE[08001] SQLDriverConnect: 0 [FreeTDS][SQL Server]Unable to connect to data source) CRITICAL: Could not connect to odbc:Driver=FreeTDS;Server=172.17.117.32;Port=1433;dbname=CensorshipDB;charset=UTF8 as nagios (Exception: SQLSTATE[08001] SQLDriverConnect: 0 [FreeTDS][SQL Server]Unable to connect to data source).
Hence may I know the workaround on this.
As below are the configurations that has been done:
Firewall Config:
SQL Server Config:
NagiosXI can detect the Server 172.17.117.32:
But cannot detect the SQL Server:
Your assistance is highly appreciated
Thank you very much and have a nice day!
Error Related to MSSQL Wizard
-
fawzankhaizuran
- Posts: 4
- Joined: Mon Sep 09, 2024 4:32 am
Error Related to MSSQL Wizard
You do not have the required permissions to view the files attached to this post.
Re: Error Related to MSSQL Wizard
Hi @fawzankhaizuran,
I think the next step is to try testing the command that the wizard is running on your CLI and see if it works there. From the error message it looks like there's a connection error with the MSSQL server you're trying to connect to, so my guess is that this will work the same. Assuming it does, you'll want to make sure you have the correct credentials and configuration for your MSSQL server. You may need to talk to your database team about the credentials you're using, and ensure that you have your XI server whitelisted to contact it. You could also try running nmap, to see if the mssql port looks available to your XI server.
Let us know if you have any questions about any of this, or if you need further assistance with any of the XI-related steps!
I think the next step is to try testing the command that the wizard is running on your CLI and see if it works there. From the error message it looks like there's a connection error with the MSSQL server you're trying to connect to, so my guess is that this will work the same. Assuming it does, you'll want to make sure you have the correct credentials and configuration for your MSSQL server. You may need to talk to your database team about the credentials you're using, and ensure that you have your XI server whitelisted to contact it. You could also try running nmap, to see if the mssql port looks available to your XI server.
Let us know if you have any questions about any of this, or if you need further assistance with any of the XI-related steps!
Re: Error Related to MSSQL Wizard
fawzankhaizuran,
I suspect the plugin for MSSQL - and thus the driver (FreeTDS) - is leveraging a TDS version that is incompatible with your version of MSSQL. To verify, you can run the check command on the command line after setting the TDSDUMP environment variable:
You should a line in the log that states a packet with an unsupported version was used in the TLS handshake, or something of the kind.
We will be releasing an updated plugin soon that lets you specify a TDS version in the check command's parameters. Until then, you could always set the environment variable in the plugin yourself with a line of PHP:
The plugin is located at:
Ensure you put it in a piece of the code that will be ran. I would recommend at the top of the function run_check(), or in main().
As for which TDS version, you will have to look up the documentation from either FreeTDS or Microsoft to verify the correct version. You could always just run the gamut: 7.0, 7.2, 7.4, 8.0, etc. Note that the format is always X.X.
I hope something here gets you further down the road to resolution.
Best Regards,
Cory Norell
I suspect the plugin for MSSQL - and thus the driver (FreeTDS) - is leveraging a TDS version that is incompatible with your version of MSSQL. To verify, you can run the check command on the command line after setting the TDSDUMP environment variable:
Code: Select all
export TDSDUMP=/tmp/freetds.logWe will be releasing an updated plugin soon that lets you specify a TDS version in the check command's parameters. Until then, you could always set the environment variable in the plugin yourself with a line of PHP:
Code: Select all
putenv("TDSVER=X.X");Code: Select all
/usr/local/nagios/libexec/check_mssql_server.phpAs for which TDS version, you will have to look up the documentation from either FreeTDS or Microsoft to verify the correct version. You could always just run the gamut: 7.0, 7.2, 7.4, 8.0, etc. Note that the format is always X.X.
I hope something here gets you further down the road to resolution.
Best Regards,
Cory Norell
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
fawzankhaizuran
- Posts: 4
- Joined: Mon Sep 09, 2024 4:32 am
Re: Error Related to MSSQL Wizard
Hi @cnorell @jsimon,
Thank you very much for both of your assistances. We highly appreciate it. It looks like the problem has been solved.
The root cause:
The MSSQL version used is 2012 while the current FreeTDS version set in the script is AUTO.
Rectification:
We amend the script by changing the FreeTDS_Version=AUTO to FreeTDS_Version=7.0 due to we suspect the AUTO will select the highest available version of FreeTDS version instead the most compatible version of the MSSQL. This is just a suspicion. The amendment is shown as below: As for now, Nagios can communicate with MSSQL2012 normally. Thank you very much and have a nice day!
Thank you very much for both of your assistances. We highly appreciate it. It looks like the problem has been solved.
The root cause:
The MSSQL version used is 2012 while the current FreeTDS version set in the script is AUTO.
Rectification:
We amend the script by changing the FreeTDS_Version=AUTO to FreeTDS_Version=7.0 due to we suspect the AUTO will select the highest available version of FreeTDS version instead the most compatible version of the MSSQL. This is just a suspicion. The amendment is shown as below: As for now, Nagios can communicate with MSSQL2012 normally. Thank you very much and have a nice day!
You do not have the required permissions to view the files attached to this post.