CI / tests (Python 3.10) (pull_request) Successful in 29s
CI / tests (Python 3.11) (pull_request) Successful in 30s
CI / tests (Python 3.12) (pull_request) Successful in 29s
CI / tests (Python 3.13) (pull_request) Successful in 28s
CI / lint (pull_request) Successful in 4s
A full /boot makes the next kernel's postinst fail: apt is left half-done
and the host quietly stays on its old kernel, which kernelwatch only
noticed indirectly, if at all. The agent now reports the size and free
space of the filesystem holding /boot (df) and the packages dpkg didn't
finish installing (half-installed, unpacked, half-configured, trigger
states or reinst-required, as dpkg --audit counts them).
The server puts a host in update when /boot has less than
boot_min_free_mb (default 200, 0 disables) free, or any package is
unfinished, with the fix in the reason ("run dpkg --configure -a"). The
host page shows both. Agents before 0.6.0 send neither field and are
judged as before. Agent 0.6.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89 lines
4.1 KiB
Markdown
89 lines
4.1 KiB
Markdown
# kernelwatch
|
|
|
|
A small, self-hosted dashboard that shows whether each machine in a Debian/Ubuntu
|
|
fleet is running its newest kernel, has updates waiting, or needs a reboot.
|
|
|
|
- **Agent**: a bash script run hourly by a systemd timer on each host. It
|
|
collects facts and POSTs them as JSON. It runs no daemon and listens on no port.
|
|
- **Server**: a standard-library Python app with SQLite. It has a token-authenticated
|
|
ingest API and a login-protected dashboard. You don't need pip, a venv or a
|
|
build step.
|
|
|
|
Supported: agents on **Debian 12/13** and **Ubuntu 22.04/24.04/26.04 LTS**; server on
|
|
**Debian 12+** or **Ubuntu 22.04+** (the system `python3`, 3.10 or newer).
|
|
|
|
```
|
|
host ──(systemd timer)── kernelwatch-agent ──HTTPS POST /api/v1/report──┐
|
|
host ──(systemd timer)── kernelwatch-agent ─────────────────────────────┤
|
|
▼
|
|
browser ──HTTPS──▶ Caddy/nginx ──▶ kernelwatch (127.0.0.1:8080) ──▶ SQLite
|
|
```
|
|
|
|
It's read-only by design: the server can't make hosts do anything.
|
|
|
|
## What you see
|
|
|
|
Each host gets one status. When several apply, the worst one wins:
|
|
|
|
| Status | Meaning |
|
|
|----------|---------|
|
|
| `stale` | No report in `stale_after_hours` (default 3h), or never. Other data can't be trusted. |
|
|
| `reboot` | A newer kernel is installed but not running, or `/run/reboot-required` exists. |
|
|
| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old, or apt itself fails, so "no updates" can't be trusted. Also when `/boot` is too full for the next kernel, or dpkg left packages half-installed. |
|
|
| `ok` | Running the newest installed kernel, with no security or kernel updates pending. |
|
|
|
|
Each row lists the reasons behind its status, and clicking a host shows its full
|
|
report and recent history. [How it works](docs/how-it-works.md) explains how the
|
|
agent works each of these out (kernel comparison, needrestart, Ubuntu Livepatch,
|
|
phased updates, package list freshness).
|
|
|
|
## Quick start
|
|
|
|
**1. Install the server** on the dashboard host:
|
|
|
|
```sh
|
|
git clone <this repo> && cd kernel-automation
|
|
sudo ./server/install.sh
|
|
sudo kernelwatch set-password admin # dashboard login
|
|
```
|
|
|
|
It listens on plain HTTP on `127.0.0.1:8080`. Put a TLS reverse proxy in front;
|
|
[Reverse proxy and access control](docs/reverse-proxy.md) has Caddy, nginx,
|
|
CloudPanel and Authelia setups.
|
|
|
|
**2. Add a host.** On the server, `sudo kernelwatch add-host web01` prints a token
|
|
(shown once). Then on the host:
|
|
|
|
```sh
|
|
sudo ./agent/install.sh --server https://kernelwatch.example.internal
|
|
# paste the token when prompted
|
|
```
|
|
|
|
or, for many hosts at once, from your workstation over SSH (after a one-time
|
|
`agent/deploy.conf`, see [Agents](docs/agents.md)):
|
|
|
|
```sh
|
|
agent/deploy.sh --register web01 db01
|
|
```
|
|
|
|
[Agents](docs/agents.md) also covers the options (private CA, needrestart, apt update,
|
|
reporting under a different name) and for upgrading the fleet.
|
|
|
|
**3. Set up alerts and backups** (recommended): [Alerts and
|
|
monitoring](docs/alerts.md) covers ntfy notifications and the heartbeat that
|
|
tells you if kernelwatch itself stops. [Operations](docs/operations.md) covers
|
|
nightly backups.
|
|
|
|
## Documentation
|
|
|
|
| Page | What's in it |
|
|
|------|--------------|
|
|
| [How it works](docs/how-it-works.md) | Status rules and how the agent collects each fact |
|
|
| [Server](docs/server.md) | Installing and upgrading, the admin commands |
|
|
| [Reverse proxy and access control](docs/reverse-proxy.md) | TLS with Caddy or nginx, CloudPanel, Authelia |
|
|
| [Agents](docs/agents.md) | Adding hosts, `agent/deploy.sh`, agent options |
|
|
| [Alerts and monitoring](docs/alerts.md) | ntfy alerts for stale, reboot and update, heartbeat monitoring |
|
|
| [Operations](docs/operations.md) | `kernelwatch status --json` for scripts, backups and restore |
|
|
| [Security notes](docs/security.md) | How tokens, sandboxing and the dashboard are locked down |
|
|
| [Development](docs/development.md) | Running the tests, a local server, ideas for later |
|