Skip to content

feat: mute on-screen outage messages via upsentry broadcast on|off|status#8

Merged
cankirca merged 1 commit into
mainfrom
feat/broadcast-toggle
Jun 21, 2026
Merged

feat: mute on-screen outage messages via upsentry broadcast on|off|status#8
cankirca merged 1 commit into
mainfrom
feat/broadcast-toggle

Conversation

@cankirca

Copy link
Copy Markdown
Owner

What

Adds upsentry broadcast on|off|status — one command to mute or restore all on-screen outage messages:

  • NUT's terminal WALL broadcasts (e.g. UPS … is unavailable, which repeats while the NUT master is unreachable)
  • the optional tmux session warning (the "save your work" message)

Notifiers (SMS / Telegram / webhook) are never affected — they keep firing.

Why

When the NUT master is unreachable, upsmon emits NOCOMM on every poll. The installer set explicit NOTIFYFLAGs for the common events but left NOCOMM/NOPARENT/REPLBATT/NOTCONFIGURED on upsmon's SYSLOG+WALL default — so those WALL messages spammed every terminal. This PR fixes that default and gives users a runtime switch.

Changes

  • bin/upsentry: new broadcast subcommand (rewrites the NOTIFYFLAG block, reloads upsmon, toggles $STATE_DIR/broadcast.disabled; preserves upsmon.conf owner/mode). UPSENTRY_UPSMON_CONF env override for testability.
  • bin/upsentry-notify.sh: skip + log the session warning when muted.
  • install.sh: set NOCOMM/NOPARENT/REPLBATT/NOTCONFIGURED to SYSLOG.
  • README.md, upsentry.conf.example, CHANGELOG.md: documented.

Testing

  • ShellCheck -S warning + bash -n clean (matches CI).
  • Event-pipeline smoke test passes.
  • Isolated end-to-end test of off → status → on → status, bad-arg rejection, idempotency, and the notify-hook mute guard (caught & fixed a dropped-last-flag bug).

🤖 Generated with Claude Code

Mute or restore on-screen outage messages with one command: NUT's terminal
WALL broadcasts plus the optional tmux "save your work" session warning.
Notifiers (SMS / Telegram / webhook) are never affected.

Also fixes a latent bug: the installer left NOCOMM/NOPARENT/REPLBATT/
NOTCONFIGURED on upsmon's SYSLOG+WALL default, so an unreachable NUT master
broadcast "UPS ... is unavailable" to every terminal on every poll. These are
now SYSLOG by default and managed by `upsentry broadcast`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cankirca cankirca merged commit c42d75b into main Jun 21, 2026
2 checks passed
@cankirca cankirca deleted the feat/broadcast-toggle branch June 21, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant