How-to monitor Microsoft SQL with a domain account
This guide explains how to monitor Microsoft SQL Server with Checkmk using a domain account instead of the default user.
LAST TESTED ON CHECKMK 2.4.0P22
Overview
This guide explains how to configure the Checkmk mk-sql plugin to monitor Microsoft SQL Server using an Active Directory domain account instead of the default SYSTEM or local database user.
Problem
By default, the mk-sql plugin runs under the local SYSTEM account or a local SQL user. In some environments, especially those with stricter security or centralized authentication requirements, this is not sufficient and a domain account must be used instead.
However, using a domain account is not automatic and requires additional configuration both on the Windows host and within Checkmk.
Solution
Prepare the domain account
First, ensure the domain account is properly set up according to our User Guide:
Grant the account access to the MSSQL database as outlined in the official documentation
Ensure the account has permission to log in interactively to the monitored Windows host
Group Managed Service Accounts (gMSA) are not supported for running Checkmk plugins.
Configure the account in Checkmk
In Checkmk, configure the agent to run the plugin using the domain account:
Go to Setup → Agents → Windows, Linux, Solaris, AIX → Agent rules → Run plugins and local checks using non-system account
Create a new rule
Enter the domain account username and password under Enable 'Run As User' for scripts
Scope the rule to the appropriate host(s)
Save the rule
Configure the MSSQL plugin
Next, configure the MSSQL plugin as usual:
Go to Setup → Agents → Windows, Linux, Solaris, AIX → Agent rules → Microsoft SQL Server (Linux, Windows)
Leave authentication set to Local integrated authentication (Windows)
Save and activate changes
Bake and deploy the agent
Next you will want to Bake and sign the agent package
Deploy the updated agent to the target host
Set required file permissions
Please note that these permissions may not be preserved upon updating the Checkmk agent.
After installation, ensure the domain account has the correct permissions on the host:
Read and write access to:
C:\ProgramData\checkmk\logs\mk-sql_rCURRENTRead access to:
C:\ProgramData\checkmk\config\mk-sql.yml
Once these steps are completed, the mk-sql plugin will run under the configured domain account and successfully monitor the MSSQL instance using domain-based authentication.