This is a small utility built as a single binary for easy deployment to monitor internet connections and reboot appropriate networking equipment if the connection is down.
It works by:
- Running HTTP, TCP or DNS checks on a regular basis.
- If all checks fail, runs a specified command on a regular basis until the connection is back up.
See INSTALL.md for installation instructions.
upd -h shows:
Tool to monitor if the network connection is up
Usage: upd [OPTIONS]
Options:
-c, --config <FILE> Use the specified TOML configuration file [env: UPD_CONFIG=]
-d, --debug Display debugging output in the console
-h, --help Print help
-V, --version Print version
Send SIGHUP to reload the configuration. If the new file is invalid, the error is logged and
the running configuration stays in force. SIGINT and SIGTERM shut down gracefully. A running
down-action command is killed; stopExec runs only when the connection comes back after the
command has run at least once.
Without --config (or UPD_CONFIG), upd uses the first of these that exists: ./.upd.toml,
upd/upd.toml in $XDG_CONFIG_HOME (~/.config when unset), the same in each directory of
$XDG_CONFIG_DIRS (/etc/xdg when unset), and /etc/upd/upd.toml.
See upd.toml for a complete, runnable example. Values can
reference environment variables with ${VAR} syntax inside string values, e.g.:
[checks.every]
normal = "${UPD_NORMAL_CHECK}"
down = "${UPD_DOWN_CHECK}"Probe-stat bucket granularity per report period is also tunable: each report
period is split into at least min buckets (default 100), and a single
bucket never aggregates more than maxSpan (default 30m):
[stats.buckets]
min = 100
maxSpan = "30m"Unknown keys in the file are rejected, so a typo fails at startup instead of being ignored. A
setting that is not there is off: leave out stats.port to have no stats server, and leave out
downAction.every.repeat to run the command once.
dns:// checks need the resolver as an IP address (dns://1.1.1.1/example.com, optionally with a
port).
Set stats.port (the examples use 42080) and upd serves statistics as JSON at http://<ip>:<port>/stats.json, on all interfaces and without authentication. With reports = ["10s", "15m", "1h", "24h", "168h"] it looks like this:
{
"isUp": true,
"reports": [
{
"period": "10s",
"availability": "100.000 %",
"downTime": "0s",
"totalProbes": 1,
"failedProbes": 0,
"failureRate": "0.000 %"
},
{
"period": "15m",
"availability": "100.000 %",
"downTime": "0s",
"totalProbes": 15,
"failedProbes": 0,
"failureRate": "0.000 %"
},
{
"period": "1h",
"availability": "100.000 %",
"downTime": "0s",
"totalProbes": 60,
"failedProbes": 0,
"failureRate": "0.000 %"
},
{
"period": "24h",
"coverage": "12h 33m 23s",
"availability": "100.000 %",
"downTime": "0s",
"totalProbes": 753,
"failedProbes": 0,
"failureRate": "0.000 %"
},
{
"period": "168h",
"coverage": "12h 33m 23s",
"availability": "100.000 %",
"downTime": "0s",
"totalProbes": 753,
"failedProbes": 0,
"failureRate": "0.000 %"
}
],
"loop": {
"lastSuccess": "11s",
"nextCheck": "49s",
"interval": "1m",
"timeSinceLastUpdate": "11s",
"totalChecksRun": 753
},
"updUptime": "12h 33m 23s",
"updVersion": "5.0.0",
"generatedAt": "2026-06-09T12:37:00.708Z"
}While the connection is down, a downAction object (iteration, sleepTime, backoffCapped) is added.
coverage appears when upd has watched for less than the period. Availability is the share of
observed time spent up, accurate to one time bucket (see stats.buckets).
Version 5 is a rewrite in Rust. The configuration format is the same, but it is stricter, and a few behaviours changed. Read this before upgrading an existing setup.
- Unknown keys are errors, so a typo fails at startup. Remove
stats.retention(the retention comes fromreports),stats.writeTimeoutandstats.idleTimeout, which 4.x ignored or accepted. A key that sits in the wrong table is also caught now: a top-levellogLevelwritten below[checks.list]used to be silently ignored. 0no longer means "off". Leave the key out instead:stats.port(no stats server),downAction.every.repeat(run once),downAction.every.expBackoffLimit(no limit).repeat,expBackoffLimit,stats.buckets.min,stats.buckets.maxSpan,stats.readTimeout,reportsentries,checks.timeoutandchecks.every.*must be greater than 0, andchecks.every.*at most 24 hours.${VAR}is expanded inside string values only, so a number such asport = ${PORT}can no longer come from a variable, and comments are no longer expanded.dns://checks need the resolver as an IP address:dns://1.1.1.1/example.com, notdns://dns.google/example.com. A hostname inhttp://andtcp://checks is fine.execandstopExecare checked when the file is loaded, so an empty or badly quoted command fails at startup, not at the first outage.logLevelalso acceptserrorandtrace. With--debug, debug output wins overlogLevel.updlooks for its configuration in more places (see Configuration), andUPD_CONFIGcan name the file../.upd.tomlstill comes first.
stopExecruns only when the connection comes back afterexecran at least once. It no longer runs whenupdshuts down or reloads.UPD_ITERATIONworks as before.- A reload (
SIGHUP) that finds an invalid file keeps the running configuration and logs the error. 4.x exited. - HTTP checks do not follow redirects: any response means the connection works. 4.x followed them.
- A down-action command runs in its own process group, and anything it started is killed with it.
- Statistics are computed from time buckets (
stats.buckets), so figures can differ slightly from 4.x.generatedAtis now UTC with milliseconds. The JSON field names are unchanged. - The log format changed from
time=… level=INFO msg="…" component=…to2026-11-14T17:46:03.976Z INFO upd::monitor: connection status changed up=true. Colour is only used on a terminal. Anything that parsesupd's logs needs updating.
-vis gone: use-Vor--version.-c,-dand-hare unchanged.- Release binaries are built for Linux (x86_64 and aarch64, in glibc and static musl builds) and macOS (Apple silicon). Windows, FreeBSD, 32-bit and macOS on Intel are no longer built; see INSTALL.md for the archive names.