Replace the device and capture health scripts with pull-health.sh #107

Merged
aluminum-ice merged 3 commits from feature/pull-health into main 2026-10-31 02:37:32 +00:00
Owner

What this PR does

Adds builder/extra/files/scripts/pull-health.sh, a read-only health check you run from your computer against a device, and removes the two scripts it replaces, pull-device-diagnostics.sh and pull-capture-health.sh.

  • A verdict first. The report opens with OK / WARN / FAIL lines, then the readings, so "is anything wrong?" has a plain answer.
  • Everything the two old scripts checked:
    • version, throttling and temperature, disk, memory, uptime;
    • every kestrel unit's state, failed units, features on and the plugin list;
    • capture config (no whitelist), the acknowledgment state, the whitelist's size, the adapter, store counts.
  • What they didn't check:
    • each unit's last start and restart count;
    • whether AngryOxide and the collector are running;
    • how recently AngryOxide's capture file was written (its kismet database is no guide: AngryOxide commits one row per frame and falls minutes behind in a busy area), and whether a leftover kismet-journal file is present;
    • AngryOxide's memory use, with a warning above 30% of RAM: it queues every frame for its database without a limit, so in a busy area its memory grows while capture runs;
    • whether the dashboard's Environment reading is current. It tells "capture is writing but the reading is stuck" apart from "capture stopped", the case behind an Environment card stuck on "Scanning the area…" while handshakes keep arriving;
    • per-unit error and traceback counts, the capture unit's locked/busy, timeout and relaunch counts (counts only), and kernel USB/Wi-Fi disconnects.
  • One private file: kestrel-health-<time>.txt, mode 600, not an archive. It refuses to save inside a git checkout. .gitignore and the real-data check now also refuse that file name, with a test.

Checklist

  • Lint passes — make lint passes locally (shellcheck included).
  • Tests pass — the real-data check's tests pass (9). The Environment verdicts were checked against fake status files (stuck while capturing, INFO while capture is off, OK when current). No package or plugin code changes. The device-side part was smoke-tested on a desktop: it runs cleanly with nothing to find, and the host name and login are masked.
  • Nothing real: no secrets, no personal information, no real data. The script holds no hosts, addresses or accounts; the SSH target is an argument.
  • Consent gates intact. Read-only:
    • no service started, stopped or restarted;
    • the management link is never touched (no nmcli, bluetoothctl, ip, rfkill, iw);
    • no sudo, and no capture content read (no hashlines, network names, BSSIDs, whitelist entries, capture file names or capture-unit log text);
    • MACs, IPs, coordinates, a custom hostname, a non-default login and quoted log text are masked on the device before the report leaves.
  • Docs updated in the same PR — scripts/README.md.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe. The build installs only pull-agent-diagnostics.sh and the README from scripts/ (see "install kestrel operator scripts" in builder/config.yml), so neither removed script was on devices and config.yml doesn't change.

Notes for review

  • The scripts README's opening says the build installs that folder "verbatim", but config.yml installs only those two files. This PR doesn't change that; it's worth a separate look.
  • First run on a real device is this script's first real test.

🤖 Generated with Claude Code

## What this PR does Adds `builder/extra/files/scripts/pull-health.sh`, a read-only health check you run from your computer against a device, and removes the two scripts it replaces, `pull-device-diagnostics.sh` and `pull-capture-health.sh`. - **A verdict first.** The report opens with OK / WARN / FAIL lines, then the readings, so "is anything wrong?" has a plain answer. - **Everything the two old scripts checked:** - version, throttling and temperature, disk, memory, uptime; - every `kestrel` unit's state, failed units, features on and the plugin list; - capture config (no whitelist), the acknowledgment state, the whitelist's size, the adapter, store counts. - **What they didn't check:** - each unit's last start and restart count; - whether AngryOxide and the collector are running; - how recently AngryOxide's **capture file** was written (its kismet database is no guide: AngryOxide commits one row per frame and falls minutes behind in a busy area), and whether a leftover `kismet-journal` file is present; - **AngryOxide's memory use**, with a warning above 30% of RAM: it queues every frame for its database without a limit, so in a busy area its memory grows while capture runs; - whether the dashboard's *Environment* reading is current. It tells "capture is writing but the reading is stuck" apart from "capture stopped", the case behind an Environment card stuck on "Scanning the area…" while handshakes keep arriving; - per-unit error and traceback counts, the capture unit's locked/busy, timeout and relaunch counts (counts only), and kernel USB/Wi-Fi disconnects. - **One private file:** `kestrel-health-<time>.txt`, mode 600, not an archive. It refuses to save inside a git checkout. `.gitignore` and the real-data check now also refuse that file name, with a test. ## Checklist - [x] **Lint passes** — `make lint` passes locally (shellcheck included). - [x] **Tests pass** — the real-data check's tests pass (9). The Environment verdicts were checked against fake status files (stuck while capturing, INFO while capture is off, OK when current). No package or plugin code changes. The device-side part was smoke-tested on a desktop: it runs cleanly with nothing to find, and the host name and login are masked. - [x] **Nothing real: no secrets, no personal information, no real data.** The script holds no hosts, addresses or accounts; the SSH target is an argument. - [x] **Consent gates intact.** Read-only: - no service started, stopped or restarted; - the management link is never touched (no `nmcli`, `bluetoothctl`, `ip`, `rfkill`, `iw`); - no sudo, and no capture content read (no hashlines, network names, BSSIDs, whitelist entries, capture file names or capture-unit log text); - MACs, IPs, coordinates, a custom hostname, a non-default login and quoted log text are masked on the device before the report leaves. - [x] **Docs updated in the same PR** — `scripts/README.md`. - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe.** The build installs only `pull-agent-diagnostics.sh` and the README from `scripts/` (see "install kestrel operator scripts" in `builder/config.yml`), so neither removed script was on devices and `config.yml` doesn't change. ## Notes for review - The scripts README's opening says the build installs that folder "verbatim", but `config.yml` installs only those two files. This PR doesn't change that; it's worth a separate look. - First run on a real device is this script's first real test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Replace the device and capture health scripts with pull-health.sh
All checks were successful
Test / test (pull_request) Successful in 22s
Lint / lint (pull_request) Successful in 32s
Test / test (push) Successful in 19s
Lint / lint (push) Successful in 32s
082f205ea3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Count journal errors by priority and don't flag the Environment reading while capture is off
All checks were successful
Test / test (push) Successful in 22s
Lint / lint (push) Successful in 33s
Lint / lint (pull_request) Successful in 32s
Test / test (pull_request) Successful in 21s
02d64eb3ef
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watch AngryOxide's capture file and memory in the health check
All checks were successful
Test / test (push) Successful in 22s
Lint / lint (push) Successful in 32s
Test / test (pull_request) Successful in 19s
Lint / lint (pull_request) Successful in 31s
66a408bacc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch feature/pull-health 2026-10-31 02:37:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!107
No description provided.