SQL Server
The SQL Server module watches SQL Server 2016 to 2025 instances on virtual machines or on-premises (2016 is deprecated): CPU and memory pressure, blocking and deadlocks, transaction log space, backups, SQL Agent jobs, the error log, the build level and every linked server. It connects with T-SQL and a read-only login.
What it monitors
| Area | Checks | Why it matters |
|---|---|---|
| CPU and memory | CPU used by the SQL Server process; page life expectancy | Sustained CPU or a falling page life expectancy is the first sign of an instance under pressure |
| Workload | Batch requests per second, blocked sessions, deadlocks per minute, top wait categories | Shows how busy the instance is and what it waits on when users say it is slow |
| Capacity | Transaction log space used | A full log stops every write in that database |
| Backups | Age of the last full backup and of the last log backup | A missing backup is data you cannot restore; log backup age is your real recovery point |
| Jobs and errors | SQL Agent job failures in the last 24 hours, error log entries of severity 16 and above | Failed maintenance and serious engine errors are easy to miss without an alert |
| Updates | Build and update level | Feeds the Track updates and advisories page with how far behind the instance is |
| Linked servers | Reachability and latency of each linked server | Applications that query through a linked server fail when it does, even with a healthy instance |
Every check, with its rule, cause and action, is in the reference for SQL Server checks. Availability groups have their own chapter: SQL Server availability groups.
Before you begin
- A monitoring login on every instance. Create it with the script in Prerequisites for availability groups. The same script serves a standalone instance: run it once on that instance. The login needs
VIEW SERVER STATE,VIEW ANY DEFINITION, optionallyCONNECT ANY DATABASE, andSELECTon themsdbbackup and job tables, and nothing else. - SQL Server authentication. The instance must accept SQL logins (mixed mode). Windows-integrated authentication is not supported, because the collector runs in a Linux container without a Kerberos ticket.
- Network. The Excubius server reaches the instance on its SQL port, 1433 by default, and on UDP 1434 for a named instance without a fixed port.
- The module is on. The feature
monitoring.databasescovers SQL Server, availability groups and PostgreSQL.
Linked servers
sqlserver.linked_server_ping lists the linked servers of the instance and runs sp_testlinkedserver on each, with a hard timeout of 5 seconds. Each linked server raises and resolves its own alert after 3 failed tests in a row.
The test only opens a connection to the remote server, and it runs as the monitoring login. The linked server therefore needs a login mapping that covers that login: either the mapping for all other logins, or one the database administrator adds:
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'<linked server>', @useself = N'FALSE',
@locallogin = N'usr_monitoring', @rmtuser = N'<remote read-only login>', @rmtpassword = N'<password>';
A linked server that refuses unmapped logins fails every test. If it cannot be mapped, list it in the check's exclude parameter:
curl -s "${H[@]}" -X PATCH "$BASE/resources/$INSTANCE/checks/sqlserver.linked_server_ping" \
-d '{"params": {"exclude": ["<linked server>"]}}'
When the default mapping to public has been removed, the login only sees the linked servers it is mapped to.
Add an instance
- Store the monitoring login as a SQL login credential on the entity, for example Ciguapa Inc.. See Store a credential for the collector.
- Open Resources › Add resource and choose SQL Server instance (VM / on-prem). Enter the host, for example
sql-ventas-01.ciguapa.example, and the port, or the instance name of a named instance. - Choose the credential, then select Create resource.
- On the resource page, select Test connection. It lists any missing permission and warns when the login is
sysadmin. - Select Discover. The instance's databases, linked servers and availability groups become child resources with their own checks.
The full wizard, with every option: Add a resource. For an availability group, follow Quickstart: add an availability group.