Mark host interfaces as unused #35

Merged
jared merged 1 commits from unused-interfaces into main 2026-11-11 17:50:14 -05:00
Owner

Why

Some ports are never meant to be up: compute-storage-01's nic1-nic3, and large1's spare NIC and USB adapter. They kept their hosts "degraded", and they were behind tonight's false alerts (#31, reverted in #33).

What changes

Device page. A down interface gets a Mark unused button (admins only) with an optional reason, and In use again undoes it. Unused rows are greyed out with a dashed dot and an "unused" badge; the reason shows on hover. The header count leaves them out, for example "3 of 3 up · 1 unused".

Monitor. An unused interface:

  • raises no link-down alert;
  • can't count toward the cluster-wide alert;
  • doesn't count toward the host's status;
  • shows as unused in the snapshot, so the dashboard host cards and the rack drawings grey it out too.

The list is reloaded every cycle.

Marking closes any link-down alert open on that interface, without a recovery note, because nothing recovered.

API. PUT / DELETE /api/device/<host>/interfaces/<iface>/unused requires admin rights. PUT takes a JSON body {reason}. Interface names are validated. /api/device/<host> returns unused_interfaces.

Schema. A new table, unused_interfaces, is created with the cutsheet tables.

Candidates on production now

These are all the down interfaces:

  • compute-storage-01: nic1, nic2, nic3
  • large1: enp36s0, enx66630b4cce4a
  • micro1: enp3s0. Leave this one: it's meant to be up and is waiting on a cable (ticket 666018103).

Testing

  • Automated: 378 tests pass, 8 new:
    • unused interfaces never alert
    • they don't degrade the host, and show as unused in the snapshot
    • API mark and clear, admin, JSON and name checks, and the device API listing
  • MariaDB:
    • marking closes an open alert quietly, with recovery_notified set so no note is queued
    • marking again updates the reason
    • clear is idempotent
  • Playwright: mark, then the row turns unused and the count updates, then undo; no JS errors.
  • Lint: flake8 is clean and ESLint reports 0 errors.

Unused interface

🤖 Generated with Claude Code

## Why Some ports are never meant to be up: compute-storage-01's `nic1`-`nic3`, and large1's spare NIC and USB adapter. They kept their hosts "degraded", and they were behind tonight's false alerts (#31, reverted in #33). ## What changes **Device page.** A down interface gets a **Mark unused** button (admins only) with an optional reason, and **In use again** undoes it. Unused rows are greyed out with a dashed dot and an "unused" badge; the reason shows on hover. The header count leaves them out, for example "3 of 3 up · 1 unused". **Monitor.** An unused interface: - raises no link-down alert; - can't count toward the cluster-wide alert; - doesn't count toward the host's status; - shows as `unused` in the snapshot, so the dashboard host cards and the rack drawings grey it out too. The list is reloaded every cycle. **Marking** closes any link-down alert open on that interface, without a recovery note, because nothing recovered. **API.** `PUT` / `DELETE /api/device/<host>/interfaces/<iface>/unused` requires admin rights. `PUT` takes a JSON body `{reason}`. Interface names are validated. `/api/device/<host>` returns `unused_interfaces`. **Schema.** A new table, `unused_interfaces`, is created with the cutsheet tables. ## Candidates on production now These are all the down interfaces: - compute-storage-01: `nic1`, `nic2`, `nic3` - large1: `enp36s0`, `enx66630b4cce4a` - micro1: `enp3s0`. Leave this one: it's meant to be up and is waiting on a cable (ticket 666018103). ## Testing - **Automated:** 378 tests pass, 8 new: - unused interfaces never alert - they don't degrade the host, and show as `unused` in the snapshot - API mark and clear, admin, JSON and name checks, and the device API listing - **MariaDB:** - marking closes an open alert quietly, with `recovery_notified` set so no note is queued - marking again updates the reason - clear is idempotent - **Playwright:** mark, then the row turns unused and the count updates, then undo; no JS errors. - **Lint:** flake8 is clean and ESLint reports 0 errors. ![Unused interface](https://code.lotusguild.org/LotusGuild/gandalf/raw/branch/pr-35-screenshots/1-unused-interface.png) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jared added 1 commit 2026-11-11 17:20:07 -05:00
Mark host interfaces as unused
Lint / JS (eslint) (push) Successful in 44s
Lint / Python (flake8) (push) Successful in 1m40s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m18s
Lint / JS (eslint) (pull_request) Successful in 10s
Security / Python Security (bandit) (pull_request) Successful in 1m13s
Test / Python Tests (pytest) (pull_request) Successful in 1m11s
Lint / Python (flake8) (pull_request) Successful in 50s
Test / Python Tests (pytest) (push) Successful in 1m1s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
3834546f38
Ports that are never meant to be up (compute-storage-01 nic1-3, large1's
spare NIC and USB adapter) kept their hosts "degraded" and were the source
of tonight's false alerts. An admin can now mark an interface unused from
the device page, with an optional reason. Unused interfaces raise no
link-down alerts, don't count toward the cluster-wide alert or the host's
status, and show greyed as "unused" on the dashboard, device page and rack.
Marking one closes any open link-down alert on it without a recovery note.

New table unused_interfaces, created with the cutsheet tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared scheduled this pull request to auto merge when all checks succeed 2026-11-11 17:50:11 -05:00
jared merged commit 6b03fe7b44 into main 2026-11-11 17:50:14 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/gandalf#35