MSSQL plugin (mssql.vbs) fails when run as SYSTEM, works as local Administrator - named instance SQL Server 2022 Express

CMK version: 2.2.0p46
OS version: Window Server 2025

Error message: Failed to connect to database (INFO: Connecting using provider msoledbsql; Connecting using provider sqloledb; Connecting using provider sqlncli11 ;; ERROR: Der Provider kann nicht gefunden werden. Möglicherweise ist er nicht richtig installiert worden.) CRIT

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Description: The MSSQL plugin (mssql.vbs) fails when executed by the CheckMK agent (running as SYSTEM), but works correctly when executed manually via PowerShell as a local Administrator.

The SQL Server instance is a named instance running SQL Server 2022 Express (not default). SQL Server Browser service is running.

The following OLE DB providers are installed on the system (verified via 32-bit and 64-bit PowerShell):

  • MSOLEDBSQL

  • MSOLEDBSQL19

  • SQLOLEDB

When running the script manually as Administrator, the plugin outputs data correctly for all sections (mssql_databases, mssql_connections, mssql_jobs, etc.).

Adding a SQL Server login for NT AUTHORITY\SYSTEM with sysadmin role did not resolve the issue.

Has anyone else experienced this issue with SQL Express specifically, or found a solution? Any hints are greatly appreciated! :folded_hands:


You really should update to a current Checkmk version which brings an executable as agent plugin for MS SQL and deprecates the VBS file.

Hey, nice to hear from you! :grinning_face_with_smiling_eyes: Yeah, an update is planned and we’re already working towards it. But in the meantime – worth a shot, right? :winking_face_with_tongue:
Interestingly, it works fine on another SQL Express instance with a named DB. I’d need to double-check which exact SQL Express version that one is running though. Any idea what could cause the difference?

1 Like

AFAIK the VBS plugin has a heuristic to determine the SQL driver.