MSSQLSERVER Login failed for user '' after upgrade

Hi,

I’m using Check_MK to monitor an MSSQL cluster. It all worked fine when using 1.6.x. After I did an upgrade to 2.0.0p3 it does not work anymore. When I run a check on the command line this is the result I get for the MSSQL service:

MSSQL_MSSQLSERVER|state|0|Connecting using provider msoledbsql. ERROR: Provider cannot be found. It may not be properly installed. Connecting using provider sqloledb. ERROR: Login failed for user ‘’. ERROR: Login failed for user ‘’. (SQLState: 42000/NativeError: 18456). Connecting using provider sqlncli11. ERROR: Login failed for user ‘’. ERROR: Login failed for user ‘’. (SQLState: 28000/NativeError: 18456).

It’s true I don’t have a user setup, so no mssql.ini. In the 1.6 release, this would work with just the local system account that is used to run the check_mk agent. To be more precise, if I switch back the mssql.vbs script to the 1.6 version it works again.

Any chance for a fix in the 2.0 version of the mssql.vbs script?

1 Like

Same issue here :-1:

I had the same problem with 2 of our systems after the upgrade to 2.0.0p3.
Reading the error message i figured there might be a problem with the msoledbsql driver.
So i went ahead and (re)installed it on both servers.
One of them is working fine now, the second one does not.
Since the second server has an SQL Server 2005 installation and is a read-only system nowadays i decided to remove the SQL checks completely.

Thanks. I’ll have to check with our DBA if it’s possible to reinstall the msoledbsql driver. Unfortunately he’s out till next Monday, so I’ll have to wait till then.

Hi Tobias,
If this only fixes the issue on one server, I guess re-installing the driver was not the reason why it started working again?
In my case the setup is this: One server running Windows Server 2012 with SQL 2014 Developer Edition (not working with newest version of mssql.vbs). One server running Windows Server 2019 with SQL 2012 Standard AND SQL 2019 Standard (working).

Other than the driver i did not change anything. So in my case it had to be the reason for one of the systems (Server2012 with SQL2014 Standard) to start working again.
My guess about the second system is that because of the version difference something doesn’t quite work out the way it does for the first one.

In our case, both servers are running on Windows Server 2012. And we’re running Microsoft SQL Server 2014 (SP3) (12.0.6433.1) - Enterprise Edition.

But I’m upgrading to Check_MK 2.0.0p4 and a quick glance at the release notes showed some changes to the MSSQL agent if I’m not mistaken. I’ll see if that one works.

I just upgraded to 2.0.0p4 and MSSQL plugin still fails. Now I’m back to running with 2.0.0p4 agent and mssql.vbs version 1.6.0p18. That still works.

Ah thanks, that saves me the trouble of trying it.

The mssql.vbs from Checkmk 2.0.0 fails at the moment the connection providers are being checked. Would you be able to find the the connection provider / OLEDB providers which are available in each of your specific versions of MSSQL and post them here?

Hmmm, I would give you that information if I only knew what you ment. (I’m more of a Linux man). So I asked our DBA and he didn’t know either. But for the old monitoring system they used to be something like this in place, does that help?

Dim cn, rs, sqlStr, strResult, htmlcolorcode
Set cn = CreateObject (“ADODB.Connection”)
cn.Open “Provider=SQLOLEDB;Data Source=” & strServer & “;Initial Catalog=master” & “;Integrated Security=SSPI”
Set rs = CreateObject (“ADODB.Recordset”)

Anycase anyone still intrested I managed to fix it with the 2.0 script, something with the check to use the providers fails unless you have OLE DB driver installed and it tries to use username/password which aren’t configured.
I simply marked down all the if and only left the connection line which solved it:

'If Not AUTH.Exists(“type”) or AUTH(“type”) = “system” Then
CONN.Properties(“Integrated Security”).Value = “SSPI”
'Else
’ CONN.Properties(“User ID”).Value = AUTH(“username”)
’ CONN.Properties(“Password”).Value = AUTH(“password”)
'End If

2 Likes

Hi,

Thanks, yes, I’m still interested. I’ll see if I can give it a go the next few days and let you know if this works for me as well.

Louis

This approach worked for me as well. Server 2012 - MSSQL 2014 Standard

Thanks Kishke for posting!

Hello

I have been fighting with this problem in the last 24hours… LOL

Resolved by installing an old version of Microsoft OLE DB Driver for SQL Server. I my case, with version 18.02 work fine

Checmk RAW 2.2.0b3, Version: Microsoft SQL Server 2016 (SP2) (13.0.5108.50) - Standard Edition (64-bit); with last version of plugin from Githug checkmk/mssql.vbs at master · Checkmk/checkmk · GitHub

Now… lets look at the data collected

2 Likes

I have the same pb with CheckMK RAW 22.0p14 on Windows hosts when OLE DB Driver is not installed. And I cannot do it (industrial servers managed by an external provider).
It works with following fix in checkmk/agents/windows/plugins/mssql.vbs at master · Checkmk/checkmk · GitHub :

If Not authenticationConfig.Exists(“type”) or authenticationConfig(“type”) = “” or authenticationConfig(“type”) = “system” Then