benchdogStart a free trial
HelpUptime

Benchdog Uptime

Know your sites, servers and services are up, from your own network.

Getting started

Your first ten minutes with Uptime

  1. Install the Benchdog Uptime extension in VS Code, or the Benchdog Uptime desktop app; each carries the engine with the benchdog uptime commands, the collector and the host agent.
  2. Press New Project in the Uptime panel, give it a name and the first URL to watch, and say whether to keep the history in a database; it writes a .uptime.json file.
  3. Add monitors in the file with IntelliSense, then press Check All Now to check every one from this computer.
  4. Press Test Project, or run benchdog uptime test --project production.uptime.json, which reaches the history store, checks every monitor once and looks for each alert channel's secret.
  5. In the desktop app, pick Service... in the Uptime menu and press Install service; or from a terminal opened as an administrator, or with sudo, run benchdog uptime service install --project production.uptime.json. The collector then checks around the clock, keeps the history and sends the alerts.
  6. Watch the Estate and Alerts views in VS Code, or the overview in the desktop app, for each monitor's state, response time and 30 day uptime.
Questions

How to, before you buy, and when something goes wrong

How do I

How do I watch a site and its certificate?

Add a monitor with "kind": "url" and its url. It checks for a 2xx status code, or the one status names, how long it takes against slowMs, 2000 by default, and a word that must be on the page with keyword, or must not be with "keywordAbsent": true. On https it reads the certificate too, a warning 30 days before it expires and critical at 7, set with warningDays and criticalDays.

For a certificate on any other host and port, such as a mail server's, use "kind": "certificate" with host and port; for the day a domain lapses, "kind": "domain" with domain. Click Check Now on a monitor in VS Code, or Ctrl+R in the desktop app, or run benchdog uptime check --project production.uptime.json --name Shop; add --fail-on critical to exit with 3 at that state or worse, for a script.

How do I set up a heartbeat for a script or a scheduled job?

Make a token with benchdog uptime heartbeat token, then add a monitor with "kind": "heartbeat", that token, a schedule such as { "every": "day", "at": "02:00" } or a cron string, and graceMinutes, 10 by default. The collector listens for calls on port 8450, and the heartbeat is down once a call is later than its grace.

Run benchdog uptime heartbeat --project production.uptime.json --name "Nightly backup" for its address and the one line to add at the end of the job: curl -fsS and the address from a shell or cron, or Invoke-RestMethod and the address from PowerShell or a scheduled task. The heartbeat's page in VS Code and the desktop app shows the same lines with a Copy button. A job that fails can call the address with /fail on the end, which alerts at once. The address carries the token, so a guessed address does nothing.

How do I watch a server with the host agent?

On the collector's machine, run benchdog uptime listener certificate --host monitor.example.com, which writes listener.pem and listener-key.pem and prints the fingerprint, and name them in the project with "listener": { "certificate": "listener.pem", "key": "listener-key.pem" }. Run benchdog uptime host token for a token and its hash, and add a monitor with "kind": "host", the hash as tokenHash, and any services and processes that must be running. Install the service again so it takes the change.

On the Windows server, with the benchdog program beside the script, run .\install-agent.ps1 -Address https://monitor.example.com:8450 -Fingerprint "<fingerprint>" from PowerShell opened as administrator, in scripts/uptime; Linux servers are coming. It asks for the token, hidden, and never takes it on the command line. It reports CPU, memory, free disk, uptime, the services and processes, and the event log errors every minute, and a host that goes quiet for its grace, 3 minutes by default, is down. benchdog uptime agent status on the server says whether it runs.

How do I get alerts by email, Teams or Slack?

Add an alerts section to the project file with its channels, each with a name, a type of email, teams or slack, and a minimumState of warning or critical, as for SQL Watchdog. Save each channel's secret with benchdog uptime secret --project production.uptime.json --channel "Ops Slack", which asks for it hidden, with Save Alert Channel Secret... in VS Code, or Save channel secret... in the desktop app. For the installed service add --service benchdog-uptime, as an administrator or with sudo. Then benchdog uptime alert test --project production.uptime.json sends a test to each channel.

Rules cover down, slow, a certificate or domain expiring, a host over its limits, a service stopped, a heartbeat late or failed, a blacklist listing, a check that failed and the history store down. An alert is said when it fires, again every hour by default while it stays, at once when it changes between warning and critical, and once more when it is fine again.

How do I keep patch night quiet with a maintenance window?

Plan one in the project file's maintenance, with a name, a schedule and how many minutes, or once from a time to a time, on the monitors and groups named, or every monitor when it names none. To start one by hand, use Start Maintenance... in VS Code, Start maintenance on the monitor's page in the desktop app, or benchdog uptime maintenance start --project production.uptime.json --minutes 60 --group Production --name "Patch night".

A window started by hand is kept in the history store, so a collector or service already running takes it in its next round. No alert opens for a monitor in a window and its checks do not count against its uptime. benchdog uptime maintenance list --project production.uptime.json shows what is on and what comes next, and benchdog uptime maintenance end --project production.uptime.json --id 3 ends one early.

How do I write an incident note and publish the status page?

Use Write Incident Note... in VS Code, New incident... on the monitor's page in the desktop app, or benchdog uptime incident open --project production.uptime.json --title "Checkout is slow" --note "We are looking into it." --monitor Shop. Add notes as it goes with benchdog uptime incident update --project production.uptime.json --id 1 --state identified --note "A payment provider is slow.", and close it with benchdog uptime incident resolve --project production.uptime.json --id 1 --note "Fixed.". The notes are shown to everyone, so never put a password or a secret in one.

Add "statusPage": { "path": "status.html", "serve": true } to the project, with monitors or groups to show only some. The collector writes the page every 5 minutes as one HTML file with no script, and with serve its listener serves it at /status. It shows each monitor's name and state with a bar a day for 90 days, the open incidents and the maintenance coming, never an address. Preview Status Page in VS Code shows it now, and benchdog uptime status-page --project production.uptime.json writes it now. Point path at a folder a web server serves.

How do I save the passwords and keys monitors sign in with?

A mail, FTP, SFTP or URL monitor with a user keeps its password only in the system's secure store: run benchdog uptime password --project production.uptime.json --monitor "Mail server", which asks for it hidden, or use Save Password... in VS Code or Save password... on the desktop page. For an SNMP device it keeps the community, and --privacy keeps a v3 privacy password. For the installed service add --service benchdog-uptime, as an administrator or with sudo.

An SFTP monitor with "signIn": "key" keeps its private key with --key-file ~/.ssh/id_ed25519, asking for the passphrase when the key has one, and leaves the file as it is. Nothing is sent to an SFTP server until it shows the host key pinned in hostKey: the first check says the server's key, so check it is the server's with ssh-keyscan piped to ssh-keygen -lf -, then pin it as "hostKey": "SHA256:...".

How do I run the collector around the clock?

In the desktop app, Service... in the Uptime menu does the same with a click: Run here runs the project in the app while it is open, Install service installs it through Windows' administrator prompt, with Open in admin terminal and Copy command beside it, and Start, Stop, Restart, Install again and Uninstall manage it, its state shown as it changes. Or run benchdog uptime service install --project production.uptime.json from a terminal opened as an administrator, and manage it with benchdog uptime service start, stop and restart. It installs the collector as benchdog-uptime, copies in the project, the listener's certificate and your licences, and starts it. Install again after changing the project or getting a new licence; the saved passwords and secrets are kept. Add --monitor estate.monitor.json for the same service to run SQL Watchdog's collector too. The .bat and .ps1 scripts in scripts/uptime do the same.

benchdog uptime service status says whether it runs and where its log is. In a terminal, benchdog uptime collect --project production.uptime.json runs the collector until Ctrl+C, and --once checks every monitor once and stops. In Docker, run the ghcr.io/simonmurrell1979/benchdog-monitor image with uptime collect --project /config/production.uptime.json as its command, the project and a licences folder mounted at /config, and port 8450 published for heartbeats and agents.

To check from more than one place, give the project its own "location", such as "London", for the main collector, which listens for heartbeats and agents, judges the alerts and sends them. On a machine elsewhere that reaches the same history store, run benchdog uptime service install --project production.uptime.json --location Frankfurt. It checks every monitor but the heartbeats and hosts and keeps its checks from Frankfurt, and the main collector alerts a warning when a monitor is down from one place and up from another, and critical when it is down from every place. Each monitor's page shows its state from each location, and the same licence covers every collector.

Before you buy

What does it need, and where does it run?

The collector runs on one machine of yours that can reach what it watches: a Windows service, or Docker. Linux and Mac services are coming. The host agent runs on Windows servers, with Linux coming. The history store is any SQL Server or Azure SQL database, and the collector makes its tables the first time.

Checks read and connect and change nothing; a mail monitor offers the server a test message and never sends it. Azure monitors read as the person signed in, and AWS monitors with the AWS CLI's own sign-in; an installed service has no one signed in, so it uses "signIn": "managedIdentity" for Azure or "signIn": "instanceRole" for AWS.

How is it different from a hosted uptime service?

Benchdog hosts nothing. The checks run from your own network, so they reach what a hosted service can not: intranet sites, printers and switches, mail and FTP servers inside the firewall, and servers behind NAT through the agent. The history, the passwords and the alerts stay with you.

The other side is that every check comes from where a collector runs. For another view, run a second collector somewhere else, such as a small VM in another region, with --location: it checks from there into the same history store, and the main collector alerts a warning when a site is down from one place and up from another, and critical when it is down from every place. A second collector costs nothing more, as the licence counts monitors, not collectors.

What counts as a monitor, and what happens past the count?

One monitor is one thing watched, whatever its kind: a URL, a certificate, a heartbeat, a host with the agent, a network device, a blacklist check or one cloud resource, each counting as one. Uptime is sold as Uptime 30, 60 or 200 monitors, with 50 more at a time on top, and anyone on the team views with the collector's licence.

Past the count the collector checks the first monitors in the project and marks the rest not licensed, kept in the store as such with no alert; going past the count never stops it. When the project has more, benchdog uptime test says how many the licence covers and how many the project has.

Where does the history go, and for how long?

Into a SQL Server or Azure SQL database you choose, in a benchdog schema. It can be the same store SQL Watchdog uses, so one overview shows both. Checks are kept for retentionDays, 90 by default and as long as you like, as the store is yours, then removed a few at a time without long locks. Once a day the collector says how big the store is, how fast it grows, and warns when its drive is under a tenth or a gigabyte free. While the store can not be reached, checks wait in memory and are kept once it can be.

Where do passwords, keys and tokens live?

Never in the project file, a log or an error. Monitor passwords, SFTP keys, SNMP communities, blacklist keys and alert channel secrets are kept only in the system's secure store, and for an installed service in the system's store for services. A heartbeat's token is in its address; for a host the project keeps only tokenHash, and the token itself is kept in the host's own secure store by the agent. A webhook address must be https, and no error ever shows it.

Can I try it before I buy?

Yes. Every tool has a thirty day trial with every feature, and no card. Ask for one at benchdog.dev/trial with your name and email, and the trial licence arrives by email, as a line to paste and a benchdog.licence file. One trial per person covers every tool at once.

What does one licence cover?

One licence is for one person and covers the VS Code extension, the desktop app and the benchdog command, on every machine that person works from. There is no machine limit. SQL Watchdog is the one tool sold by servers: one instance is a collector and up to three servers, a server being one host with any number of SQL Server instances, one VM, one PaaS instance or five Azure SQL databases, and anyone on your team views what it keeps. Buy more instances for more servers; past the count, the collector checks the first servers in the project and says the rest are not licensed. Buying another tool reissues your licence with that tool added.

The licence shows whose it is: your name and email appear in each tool's About and account menu.

I lost my licence. How do I get it again?

Go to benchdog.dev/licence, enter the email address you bought or started your trial with, and a six digit code comes to it. Enter the code, and every licence that address holds comes by email again. Nothing is shown on the page, and a licence only ever goes to the address it was issued to. A tool's licence screen does the same with Get my licence.

What happens when my subscription ends?

The tool keeps working for thirty days of grace after your paid year ends, and says a renewal is due from thirty days before. Once the grace is over, its main actions stop until you renew, as after a trial. A renewal emails the licence again, and a tool picks it up when you check for a newer licence. An installed SQL Watchdog, Uptime or SQL Scheduler service never stops without warning: it counts down thirty days with an alert a day, then stops, and SQL Scheduler keeps running backup steps whatever the licence.

Which operating systems and SQL Server versions does it support?

The VS Code extensions run in VS Code 1.95 or later on Windows. The desktop apps and the benchdog command are single programs for Windows (x64), with no .NET install needed. Mac and Linux are coming. The SQL tools work with SQL Server 2017 or later, Azure SQL Database and Azure SQL Managed Instance.

Does Benchdog send my data anywhere?

No. The engine runs on your machine, reads your vaults and databases as you, and keeps the results with you. A tool contacts benchdog.dev only when you click something that needs it, such as asking for your licence, and never in the background. Licences are checked offline.

Can a tool damage my database?

Every change a tool makes runs in one transaction with XACT_ABORT on, so it all happens or none of it does. A SQL Schema Compare deploy, a SQL Data Comparer sync and a SQL Data Filler fill are each one transaction, and SQL Data Scrambler scrambles each table in one. The scripts the tools write for you to run in SSMS or sqlcmd are wrapped the same way and roll back if any batch fails. SQL Multi Runner runs your own script as it is, and wraps each database in a transaction when you tick that. Before any change, a tool says what it will do and asks first: SQL Schema Compare names the tables and columns whose rows go, SQL Data Comparer says how many rows change, and SQL Data Scrambler asks you to type the database's name. SQL Schema Compare also stops if either database changed after you read the plan. Even so, nothing replaces a backup, and the SQL Server tools can take one first.

How does it sign in?

Azure calls run as you, through a browser sign-in once or through your existing az login, in any tenant you belong to. The SQL tools use your Microsoft account, your Windows sign-in or a SQL login, and every connection is encrypted. A SQL login's password is kept until the app closes, or in your system's secure store (DPAPI on Windows, Keychain on Mac, libsecret on Linux) if you tick Remember. It is never written to a settings file, a project file or a log.

When something goes wrong

An SFTP monitor says The host key is not pinned.

Benchdog sends nothing to an SFTP server until it shows the host key you pinned, so a password or key never goes to the wrong server. The check's summary gives the key it saw, after Its key is. Check it is the server's with ssh-keyscan on the server piped to ssh-keygen -lf -, then put it in the monitor's hostKey. If the message is The host key changed., the server showed a different key: it may have been rebuilt, or someone may be in between, so pin the new key only once you know it is the server's.

A check says The password for ops is not saved. Save it with: benchdog uptime password --project production.uptime.json --monitor "Mail server"

The monitor has a user whose password Benchdog does not have. Run the command it gives; it asks for the password, hidden. For the installed service the message names --service benchdog-uptime too, and the command needs an administrator or sudo. For an SFTP monitor that signs in with a key the message says The private key for and ends with --key-file <file>.

A heartbeat is late even though the job ran

The call did not reach the collector. If the collector's log says Could not listen on port 8450, so every heartbeat and host will be late., another program has the port; set another, such as "listener": { "port": 8460 }, and give callers the new address. A call answered with No heartbeat has that token. has a token that does not match the monitor's. When callers reach the collector by another name than the machine's, set "listener": { "address": "http://monitor.example.com:8450" } so the address shown is one they can reach, and open the port in the firewall.

benchdog uptime host says Agents report tokens over it, so give the listener a certificate

The listener serves plain HTTP, and an agent's token should not cross the network in the clear. Run benchdog uptime listener certificate --host monitor.example.com, name listener.pem and listener-key.pem in the project's listener, and install the service again. Give the agents the fingerprint it prints, or the one benchdog uptime host shows.

The agent says Could not reach the collector at https://monitor.example.com:8450.

The rest of the message says why. Check the port is open from the host, the address is the one benchdog uptime host shows, and the fingerprint is the listener certificate's, which changes when you make a new certificate; install the agent again with the new one. The collector answered 404: No host has that token. means no host in the project has that token's hash: put the tokenHash that came with the token in the project, then install the service again so it takes the change.

A monitor says Not licensed.

Its summary says Not checked: the licence covers 30 monitors, and this is number 31 in the project. The collector checks the first monitors in the project up to the licence's count and marks the rest not licensed, and the Estate view shows them with a slash. Buy more monitors, 50 at a time, or take a monitor out. Moving a monitor up the file changes which ones are checked.

How do I get a log of what happened?

Turn on the diagnostics log: in a desktop app, Settings, then Write a diagnostics log; in VS Code, the extension's diagnostics setting; for the benchdog command, set the environment variable BENCHDOG_DIAGNOSTICS=1. Each run writes one file to the logs folder in the Benchdog folder (%LOCALAPPDATA%\Benchdog\logs on Windows, ~/Library/Application Support/Benchdog/logs on Mac, ~/.local/share/Benchdog/logs on Linux), and the last ten are kept. The desktop apps have Open logs folder, and VS Code has the Open Diagnostics Logs Folder command.

The log records sign-in requests, Azure calls, engine requests, SQL connections, times and errors. Passwords, connection strings, tokens, secret values and your data are never written, so it is safe to send to support.

The desktop app showed an error window. What now?

That is the crash window, for an error the app did not expect. Copy details puts the error and its details on the clipboard, Email support opens a message to support with them, and Open logs folder shows the crash report, which is written even with the diagnostics log off. If the error happened on a background thread the app has to close, and the window shows when it next starts.

Sign-in on Linux stops with SecureStoreUnavailableException.

Browser sign-in keeps its tokens in the desktop keyring, and that machine has none unlocked, which is common in WSL. Install and unlock a keyring such as GNOME Keyring or KWallet, or sign in with az login and turn on Use az login in Settings or pass --cli to the benchdog command. Benchdog never falls back to a plain file for tokens.

It says the server's certificate is not trusted.

The SQL Server you connected to uses a certificate your machine does not trust, which is usual for a server on your own network with a self-signed certificate. Pick Trust the server's certificate in the picker, or add --trust-server-certificate on the command line, for servers you know. For a server you do not know, install its certificate chain instead.

How do I remove a SQL password Benchdog remembered?

In a desktop app, choose Forget saved password from the menu. On the command line, run benchdog sql forget-password --server <server> --sql-login <login>. Either removes it from the system's secure store, which is the only place it was kept.

Where do I get help?

Write to support@benchdog.dev or use the support form on this site, and a person replies. Say which tool and version you were using (Help, About in a desktop app shows both), what you did and what you saw, and attach the diagnostics log if you have one.

Not answered here? Ask on the support form and a person replies.