Commit Graph
100 Commits
Author SHA1 Message Date
andreasandClaude Sonnet 4.6 3a546a1e5c feat: fetch-based Update/Delete buttons with toast notification on Host Overview
Replace href navigation with fetch() so the server response is captured
and displayed in a slide-up toast at the bottom of the page. Delete also
removes the host card from the DOM on success without a page reload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 08:16:54 -04:00
andreas 74c89d098c version 5.1.17
Release / release (push) Successful in 5s
2026-05-04 08:04:01 -04:00
andreasandClaude Sonnet 4.6 3301dbfe34 feat: owner Update/Delete buttons on Host Overview; purge stale alerts on reload
Host Overview (plugins.html): show Update and Delete buttons in the
host-right zone when the logged-in user is the host owner (or admin /
unauthenticated mode). Buttons link to /u?h=<host> and /d?h=<host>
with stopPropagation so they don't toggle the accordion; Delete prompts
for confirmation first.

ThresholdChecker.purge_stale_alerts(): removes alert states whose
metric_path has no matching threshold in the current config. Called
after startup pickle restore and after every SIGHUP config reload so
alerts orphaned by upgrades or config changes do not persist
indefinitely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 08:03:46 -04:00
andreasandClaude Sonnet 4.6 d00d903e7d fix: make Alerts page scrollable
Override the global style.css body height/overflow that locks all pages
to the viewport height (a remnant of the old drawer-menu layout).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 13:33:08 +02:00
andreasandClaude Sonnet 4.6 babb5d61aa docs: update README with changes since 917d6a4
- ZFS monitor plugin (zfs_monitor) added to plugin list and features
- nagios_runner: async execution, stderr capture, signal handling, path validation
- Threshold alerting: de-escalation suppression, short-duration suppression, ping_monitor thresholds
- Per-host watch flag and role-filtered dashboards
- HTTP API & Web UI: hostname links in Live View, Host Overview with ZFS renderer, alert pie chart in nav bar, Settings threshold viewer
- hbc connection retry: indefinite retry for IPv4; IPv6 dropped after 3 early startup failures
- hbc daemon mode: logs routed to syslog after daemonizing
- hbc_mini: noted zfs_monitor and IPv6 early-fail protection not available

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 12:46:35 +02:00
andreasandClaude Sonnet 4.6 11d1c718b3 feat: retry AsyncConnection.open() indefinitely; drop IPv6 only on early startup failure
IPv4 connections are retried forever in heartbeat_sender if open() fails,
so a temporary network outage does not terminate the sender.

IPv6 connections that have never opened successfully are dropped after
IPV6_EARLY_FAIL_LIMIT (3) consecutive failures so that a network without
IPv6 support does not keep a dead sender running.

At startup all resolved connections are added to the list regardless of
whether the initial open() succeeds; the heartbeat_sender loop handles
the first real connection attempt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 12:29:35 +02:00
andreas 7d8ca5d8db version 5.1.3
Release / release (push) Successful in 4s
2026-04-25 16:52:56 +02:00
andreas 56037a036d fix: remove unused pytest import in test_nagios_runner 2026-04-25 16:39:56 +02:00
andreas 65ceb31d8d fix: use os.path.exists check for /dev/log instead of dead-code OSError catch 2026-04-25 16:36:00 +02:00
andreasandClaude Sonnet 4.6 1c9b6c1ca9 fix: reconfigure logging to syslog after daemonize() instead of no-op basicConfig
After daemonize() redirects stderr to /dev/null, the existing StreamHandler
writes to /dev/null. logging.basicConfig() is a no-op when handlers are
already configured, so log messages are silently lost.

Replace the daemon block to:
1. Call daemonize() first
2. Explicitly remove existing handlers (pointing to /dev/null)
3. Add SysLogHandler pointing to /dev/log with fallback to UDP localhost:514
4. Log startup message to the new syslog handler

Removes redundant syslog.openlog() call which is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 16:29:54 +02:00
andreas d7e6b478e1 fix: use shlex.split() in nagios_runner path validation to handle quoted paths 2026-04-25 16:28:32 +02:00
andreas 535dbda47d feat: validate absolute command paths at nagios_runner init 2026-04-25 16:24:33 +02:00
andreas c9567dddae fix: remove stale shell config key from NagiosRunnerPlugin docstring 2026-04-25 16:23:03 +02:00
andreasandClaude Sonnet 4.6 b5963badd6 feat: async subprocess in nagios_runner with stderr capture and signal handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 16:18:09 +02:00
andreasandClaude Sonnet 4.6 a76a39b4a0 fix: remove redundant no-commands log lines; fix skip_reason docstring style
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 16:15:44 +02:00
andreasandClaude Sonnet 4.6 94e1597978 feat: set skip_reason on nagios_runner when no commands configured
When NagiosRunnerPlugin has no commands configured, set skip_reason before
returning False from initialize(). This allows PluginLoader to log INFO
(not WARNING) when the plugin is skipped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 16:13:03 +02:00
andreas c9c2ed772f fix: document skip_reason in Plugin docstring; remove unused import in test 2026-04-25 16:10:35 +02:00
andreas aeb78dcb8e feat: add skip_reason to Plugin; improve PluginLoader init messaging 2026-04-25 16:08:07 +02:00
andreasandClaude Sonnet 4.6 77b337e4dd Add implementation plan for plugin error checking and daemon logging fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 16:04:13 +02:00
andreasandClaude Sonnet 4.6 293461f3f6 Add design spec for plugin error checking and daemon logging fixes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 15:49:09 +02:00
andreas c70a4807dc version 5.1.2
Release / release (push) Successful in 6s
2026-04-25 07:25:06 +02:00
andreasandClaude Sonnet 4.6 1a470e7cfa Fix plugin config lookup shadowed by CLIENT_DEFAULTS plugins key
CLIENT_DEFAULTS seeds "plugins": {} so raw_config.get("plugins", raw_config)
always returned the empty subdict instead of falling back to the full config.
Plugins configured at top-level (e.g. nagios_runner: ...) were therefore
never found, resulting in "No Nagios commands configured".

Now checks the plugins subdict first, then top-level keys, so both
config layouts work correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 12:58:42 +02:00
andreasandClaude Sonnet 4.6 990c658e65 Apply grace period to all threshold alerts before logging/notifying
Threshold alerts (plugin metrics, RTT) were firing immediately on the
first breach. Now every state transition to WARNING/CRITICAL starts a
grace-period timer (grace_seconds from the 'grace' config key). The
notification is deferred until the next heartbeat after grace_seconds
have elapsed. If the metric recovers within the grace window, both the
alert and the recovery are suppressed — no spurious pages for transient
spikes.

Two helper methods added to ThresholdChecker:
- _apply_grace: handles the state-change path (defer or suppress)
- _check_pending_or_renotify: handles the stable-alert path (fire
  deferred notification once grace expires, or fall through to reminders)

The overdue case is unchanged — on_overdue already fires only after
interval+grace seconds of silence, which is equivalent behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 12:00:40 +02:00
andreasandClaude Sonnet 4.6 b78d6ac0fe Fix RECOVER routing: use consistent level name and route via alerted channel
threshold.py was emitting level="RECOVERED" for metric recoveries, which
failed the is_recover check in send_notification (which only matched "RECOVER"),
bypassing _alerted_channels routing and the min_level bypass added in the
previous commit. Changed to "RECOVER" so all recovery paths are consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 11:29:04 +02:00
andreasandClaude Sonnet 4.6 afd5060f59 Fix early reminder notifications and lost recovery notifications
- AlertState.update() now resets last_notification when the alert level
  changes, so a WARNING→CRITICAL escalation restarts the reminder interval
  rather than inheriting a nearly-expired timer.
- _dispatch_to_channel() bypasses min_level for RECOVER, so recovery
  notifications are delivered even after a server restart when
  _alerted_channels is empty and the fallback dispatch path is used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 18:11:22 +02:00
andreas f61f7aebc2 Use python3 consistently 2026-04-19 09:49:30 +02:00
andreas 79bf00abfd version 5.0.12
Release / release (push) Successful in 6s
2026-04-08 16:47:12 -04:00
andreas d77277857f Add user management and a settings page 2026-04-08 16:21:55 -04:00
andreas 02bc42fbf0 get rtt time differently 2026-04-07 10:40:12 -04:00
andreas 832a8b0bda save state to pickle file, restart timers on restart 2026-04-06 17:24:59 -04:00
andreas 83d5ead471 Merge branch 'master' of git.wrede.ca:andreas/heartbeat 2026-02-09 07:25:47 -05:00
andreas d339133981 collect correct args for restart 2026-02-09 07:25:42 -05:00
andreas 7be129ad40 collect correct args for restart 2026-02-09 07:22:44 -05:00
andreas 179048e565 bump 2026-02-08 16:10:37 -05:00
andreas 8fe64ae8c5 version 5.0.3 2026-02-08 16:10:02 -05:00
andreas b6574872cc remove egg-info 2026-02-08 16:08:18 -05:00
andreas 5e6dfc75ad link and flake cleanup 2026-02-08 16:05:03 -05:00
andreas 087a264e97 typo 2026-02-08 14:45:06 -05:00
andreas d9ca0b74e2 fix -i option 2026-02-08 14:42:10 -05:00
andreas 999740bc99 version 5.0.2 2026-02-08 14:40:59 -05:00
andreas 4c53b7cec9 support SSL ws session 2026-02-08 14:32:12 -05:00
andreas 535b839bfc Add smtp auth 2026-02-06 20:04:12 -05:00
andreas e3dd461d04 fix order of AFs 2026-02-06 19:49:21 -05:00
andreas e55a81568f make socket listen on IPv4 and IPv6 2026-02-06 19:25:23 -05:00
andreas 83fbba433e use system packages 2026-02-06 17:04:15 -05:00
andreas a494b162cd remove 2026-02-06 16:54:49 -05:00
andreas 83b7139643 typo 2026-02-06 15:53:01 -05:00
andreas 5dca9369dd fix bumpminor.sh script 2026-02-06 15:51:48 -05:00
andreas 3748a6fc8f add install script 2026-02-06 15:39:26 -05:00
andreas 3ca619e86d add hbc and prepare for package 2026-02-06 15:19:14 -05:00
andreas 4df700e4ef refactor and rewrite for asyncio 2026-02-06 12:34:59 -05:00
andreas 700ea8d6a4 refactor 2026-02-04 12:45:35 -05:00
andreas 0a27b763f7 re-fix cert path 2025-02-28 16:39:08 -05:00
andreas e2fd6acac0 Revert "use hbd as certificate host"
This reverts commit 058a048224.
2025-02-01 13:45:33 -05:00
andreas cc1dbd5ecb start event loop early 2025-02-01 12:41:18 -05:00
andreas 058a048224 use hbd as certificate host 2024-09-07 07:13:56 -04:00
andreas f052baae75 unbuffered cmd subprocess 2024-06-03 15:40:31 -04:00
andreas 4dd06a2969 keep IPv4 addrs as IPv4 2024-04-21 15:56:21 -04:00
andreas fda5648046 keep IPv4 addrs as IPv4 2024-04-21 15:55:28 -04:00
andreas 44ca879e76 use rndc key, Kdy... {key,private} gives strange errors 2022-12-30 16:05:14 -05:00
andreas 90f7d6b045 up msg list to last 100 2022-04-11 17:20:12 -04:00
andreas abf4e4d586 init display state pproperly 2022-03-15 16:20:12 -04:00
andreas 38cd881b22 more uppercase constants 2022-03-15 15:38:48 -04:00
andreas dda2513d27 remove ond connections 2022-03-15 15:35:01 -04:00
andreas d40ee33ece upper case constants 2022-03-15 15:34:45 -04:00
andreas 96eb380d58 cpitalize constants 2022-03-09 08:46:41 -05:00
andreas cddf809759 formating and vscode problems 2022-03-05 17:28:04 -05:00
andreas be5858428c start hbc only after we hav a network connection 2022-01-22 08:36:45 -05:00
andreas e911fc4420 formating 2022-01-20 20:14:59 -05:00
andreas 6caf808301 Merge branch 'master' of git.wrede.ca:andreas/heartbeat
sequence
2022-01-17 04:01:00 -05:00
andreas 3c041af5cc subprotocols must be a list, not a str 2022-01-17 04:00:45 -05:00
andreas a38d182189 Merge branch 'master' of git.wrede.ca:andreas/heartbeat
sequence
2022-01-10 15:20:05 -05:00
andreas 4e7fb6237f run_rbc protect agains double execution 2022-01-10 15:16:57 -05:00
andreas 2377b3367a run_rbc protect agains double execution 2022-01-10 15:04:21 -05:00
andreas 112a9f4aac add msg to install script 2021-11-28 12:25:55 -05:00
andreas 98eed4e045 fix signal message handling 2021-10-28 06:28:27 -04:00
andreas a8cb713b57 use local signal-cli 2021-09-17 06:32:53 -04:00
andreas 6ac69ac4ca spelling 2021-06-20 15:42:56 -04:00
andreas b0e93fb295 cleanup SSL handling 2021-06-20 13:40:49 -04:00
andreas 3fc70da932 cleanup SSL handling 2021-06-20 13:15:31 -04:00
andreas e00e0928bb report ws clients 2021-06-19 21:38:56 -04:00
andreas 3e771d7aba also listen on a SSL websocket 2021-06-16 16:41:03 -04:00
andreas d27ad50c0e don't exit when client closes 2021-06-07 13:34:06 -04:00
andreas 8a4042f95f fix requirements 2021-06-07 11:29:39 -04:00
andreas 13b009d6e0 ass ginal as msg carrier 2021-06-07 11:28:35 -04:00
andreas a74e3f6d04 cleanup 2021-06-07 08:47:06 -04:00
andreas edf45c033f typo 2021-05-18 10:58:15 -04:00
andreas 088647c4b4 tell websockets about verdue host 2021-05-17 05:26:51 -04:00
andreas 25c548344b only one event loop 2021-05-16 22:02:54 -04:00
andreas 9a598d1de1 bump version 2021-05-16 10:21:54 -04:00
andreas 6624cc9e23 add websocket server 2021-05-16 10:19:54 -04:00
andreas d952656dc1 enable lint 2021-05-03 17:39:31 -04:00
andreas 0d954937bb 2to3 and black 2021-05-03 17:39:08 -04:00
andreas e9c2ebf60e remove unwanted files 2021-05-03 17:31:15 -04:00
andreas 3252340eb8 re-format with black 2021-05-03 17:26:42 -04:00
andreas 62ef10620f re-format with black 2021-05-03 17:24:04 -04:00
andreas 4d7442d70c re-format with black 2021-05-03 17:21:56 -04:00
andreas aebd1e8b01 add VSCode settings 2021-05-03 17:20:57 -04:00
andreas 1aee4f154f catch exception 2021-05-03 17:17:49 -04:00
andreas 0950513d82 wapanafa to wrede 2021-04-23 13:25:48 -04:00