繁體中文

SqlLookout

A free, self-hosted SQL Server monitoring tool for Windows. It watches backups, CHECKDB, disks, blocking and deadlocks, and emails you when something needs attention.

Open source under the MIT license. Still a work in progress: version 0.9.x, expect rough edges.

What it does

  • Connects to your SQL Server instances from one machine, with a read-only login, and installs nothing on them.
  • Is set up in a web page: add servers, press Test, and every check shows whether it works or which permission is missing.
  • Keeps history in a local SQLite file, with charts for 6 hours, 24 hours, 7 days or 30 days.
  • Sends email, and a Teams message if you want, when something needs attention. Pages and alert emails come in English and Traditional Chinese.

What it watches

Backups and CHECKDB

Age of the last full backup and the last good DBCC CHECKDB, suspect pages, database state (SUSPECT, OFFLINE, EMERGENCY, RECOVERY_PENDING).

Disks and log files

Disk free space, how fast a volume is filling, log usage, tempdb space, the Express size cap. File sizes are kept for history.

Performance

Blocking (with the head blocker named), deadlocks, CPU, page life expectancy, memory grants, user connections, disk I/O latency. Top waits are kept for history.

SQL Agent jobs

A job whose last run failed, or one running much longer than its average.

Always On, log shipping, mirroring

Availability group replicas and data movement, log shipping backup and restore age, mirrored databases and the witness.

Failed logins

Bursts of failed logins counted from the SQL Server error log (error 18456), with the busiest logins and client addresses.

Unreachable servers

Failed connections in a row, and checks that keep failing or being denied.

Every limit can be changed in Settings, each alert group can be switched off, and a server can have its own thresholds. The full list with the default limits is in the README.

Start in three steps

  1. Create the read-only login. On each SQL Server, run sql/create-readonly-login.sql as a sysadmin (edit the name and password at the top). It can read metadata and statistics only.
  2. Run it. On the monitoring machine, unzip the release and run sqllookout.exe web. Open https://localhost:8443/ on that machine and create the administrator account.
  3. Add your servers. Go to Servers > Add a server, fill in the name and login, press Test. Data appears on the Dashboard within a minute. Then set up email and Teams under Settings.

To keep it running as a Windows service, double-click Setup.cmd in the unzipped folder. A setup page opens in your browser where you pick the folders, the port and the service account, then press Install. The same page offers Upgrade and Uninstall later.

Security

  • The monitoring login is read-only. SqlLookout never writes to your SQL Servers.
  • HTTPS only. No plain-HTTP port exists.
  • Pages contain no JavaScript, and the content security policy forbids it. Forms carry anti-forgery tokens.
  • SQL passwords, the SMTP password and the Teams webhook address are stored encrypted with Windows DPAPI and never shown again.

Questions

Does SqlLookout install anything on the monitored SQL Servers?
No. It connects to your SQL Server instances from one machine with a read-only login and installs nothing on them. On each server you only run a script once to create that login.
Does it write to my SQL Servers?
No. The monitoring login can read metadata and statistics only: no table data, no writes. SqlLookout never writes to your SQL Servers.
Which SQL Server versions are supported?
SQL Server 2008 and later. Express is supported, without the Agent checks. The availability group check needs SQL Server 2012 or later with Always On turned on.
Where is the monitoring history kept?
In a local SQLite file in the data folder on the monitoring machine. Optionally, the history and settings can be kept in a SQL Server database instead.
How are alerts sent?
By email, and if you want, as a Teams message to a chat or channel. A problem is mailed once, again after the repeat time while it stays active, immediately if it gets worse, and once more when it clears. A daily summary mail also tells you the service is still running.