feat: mute on-screen outage messages via upsentry broadcast on|off|status#8
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
upsentry broadcast on|off|status— one command to mute or restore all on-screen outage messages:WALLbroadcasts (e.g.UPS … is unavailable, which repeats while the NUT master is unreachable)Notifiers (SMS / Telegram / webhook) are never affected — they keep firing.
Why
When the NUT master is unreachable, upsmon emits
NOCOMMon every poll. The installer set explicitNOTIFYFLAGs for the common events but leftNOCOMM/NOPARENT/REPLBATT/NOTCONFIGUREDon upsmon'sSYSLOG+WALLdefault — so thoseWALLmessages spammed every terminal. This PR fixes that default and gives users a runtime switch.Changes
bin/upsentry: newbroadcastsubcommand (rewrites theNOTIFYFLAGblock, reloads upsmon, toggles$STATE_DIR/broadcast.disabled; preserves upsmon.conf owner/mode).UPSENTRY_UPSMON_CONFenv override for testability.bin/upsentry-notify.sh: skip + log the session warning when muted.install.sh: setNOCOMM/NOPARENT/REPLBATT/NOTCONFIGUREDtoSYSLOG.README.md,upsentry.conf.example,CHANGELOG.md: documented.Testing
-S warning+bash -nclean (matches CI).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