A SQL Server health check that runs itself and keeps the score
A health-check script run by hand says what is wrong today. DBA Brain, an open-source DBA tool, runs its checks on a schedule against every SQL Server you list, grades each one OK, WARNING or CRITICAL against thresholds you keep in a file, alerts you when one changes, and keeps the history - so last night is a query away, for you, a report or an AI agent.
Six kinds of checks on every instance
Availability
The instance and each database's state, Always On availability group databases, linked servers that answer or not, and the critical lines of the error log.
Capacity
Data file and log space, why a log cannot be reused, tempdb, free space on the volumes, the VLF count, and the size of each database's data and log files.
Performance
CPU and memory, waits, blocking and deadlocks, long-running queries, page life expectancy, memory grants pending, I/O latency, the top queries and their latency percentiles, Query Store's regressions.
Recoverability
How old each database's last backup is and how the last one ended, the backup jobs, when DBCC CHECKDB last ran clean, suspect pages, and transactions left open that hold locks.
Security
Failed logins, the health of logins and server principals, database users' permissions, certificates about to expire, and which databases are encrypted.
Maintenance
SQL Server Agent jobs that failed or ran long, index and heap fragmentation, statistics left old, index usage, foreign keys and CHECK constraints left disabled or untrusted, the server's configuration and where its files sit.
A verdict per check, and the evidence only for what is wrong
Your policy, in a file
Every threshold lives in data/metric_definitions.json, kept in version control: a change is a diff and a review. One server can take another severity for one check, or switch it off, with one command (metric-severity, metric-toggle).
Alerts that say what changed
A check that turns WARNING or CRITICAL reaches the chat its severity is routed to, one message at a time, and commands sent back are held to the person's clearance and the chat's.
History, reports, SLA
Every reading is kept: per-server metric pages, the fleet inventory, index usage and SLA pages are built from it, with a freshness gate - a number that stopped arriving is never shown as a current one.
The checks you would run, run for you
A health-check script is a good first look, and it stays one: it runs when someone remembers, its thresholds
sit in its code, and what it found is gone when the window closes. DBA Brain runs the checks on a schedule, keeps
every reading, grades each against the policy you wrote, and tells you when a grade changes. An AI agent asks
db-status for the verdict instead of reading rows (SQL Server MCP
server).
Install, name your servers, start the daemon
The checks, the grading and the SLA work with no dbabrain key and no internet; Telegram alerts need the internet, and the HTML reports a free key (what a key is).
pip install "dbabrain[mssql]" dbabrain init dbabrain daemon
Between the second and the third line, your SQL Servers go into data/db_instances.json and their
logins into the encrypted store: the quick start, and
everything else DBA Brain does.
Questions asked first
Does it install anything on the SQL Server?
No agent, no extension, no stored procedure. DBA Brain runs on a machine of its own and asks its questions over a connection and a login you already have; the checks only read.
Which SQL Server versions?
The current versions, and SQL Server 2008 R2 with a set of checks written for it.
What about Oracle, PostgreSQL and MySQL?
The same loop with each engine's own checks (Oracle health check), graded against the same kind of policy; around ninety metrics across the engines.
Can someone set it up for us?
Yes - setting up DBA Brain on your servers, and SQL Server work in general, are among the DBA work we do: see what we do.