Repository navigation
Custom checks: user-defined scheduled checks with notifications (Monitor) #544
Replies: 3 comments 1 reply
|
Hi @MaEscalanteHe, thank you for writing this up before starting. It's clear and well thought out, and I like the idea a lot. It doesn't overlap with the Addons idea. Addons would be third-party applications that plug into ProxMenux; custom checks are a feature of the Monitor itself. If Addons ever happen, a check type could be one of the things an addon brings, but nothing in your design would get in the way. The approach looks right to me: following the scheduled-update precedent instead of health_monitor.py, a timeout per run, the config in /etc/proxmenux with atomic writes, and @require_admin_scope on every route, GET included. A few thoughts: The command type is the one I'd be most careful with. Since it runs as root, I'd keep the warning very visible and make the command something only an admin can create or edit, exactly as you describe. |
|
I read the notification path on 1. Quiet Hours will buffer every run, not every failure. In 2. The 24 h default cooldown hides flaps. Neither new type is in the overrides in 3. Recoveries should skip aggregation and the digest. The burst aggregator groups any type not in 4. The 5. Severity decides Quiet Hours. Only 6. Dismissals. There's no Health panel entry to dismiss from, but the store already exists: Disclosure: I maintain Cue (https://github.com/murtazox04/Cue), an open-source notification policy library (quiet hours, caps, digests). It isn't a fit here: ProxMenux already has the whole pipeline, and the fixes above are a few lines inside it. |
|
Thank you so much @murtazox04, this is a wonderful review. Going through the real delivery path like this saves a lot of work before a single line is written, and I'm very grateful for it. @MaEscalanteHe, I'd take this into account when you start. For me the key is having the scheduler notify only when a check changes state, plus the daily reminder while it keeps failing, because the rest becomes much simpler that way. A severity per check also sounds like a good idea. On dismissals, I think I'd lean towards the simpler option: a mute stored with the check itself would keep custom checks out of the Health panel, as you planned. It's your call when you get to the design, though. Thank you both, it's a pleasure to see this taking shape. |
Uh oh!
There was an error while loading. Please reload this page.
Hi! Now that 1.2.7 is out I'd like to pick up a Monitor feature and check it fits before writing code.
What. "Custom checks": checks the user defines from Settings, run on a schedule, that notify through the existing channels when they start failing, remind about once a day while they keep failing, and notify when they recover.
lxc_apps.cron_matches.custom_check_failedandcustom_check_recovered(grouphealth).How. It follows the LXC scheduled-update precedent rather than
health_monitor.py: a dedicated scheduler thread like_scheduler_loop, each run in its own worker with a timeout (max 4 concurrent), and events emitted withnotification_manager.emit_event. The reason: checks are user-scheduled and can take seconds, andget_detailed_status()also runs synchronously from/api/health/*requests. Config lives in/etc/proxmenux/custom_checks.json(0600, atomic writes like custom links); only the last result is kept, inuser_settings. Not shown in the Health panel.Security. Commands run as root, so every route (GET included) uses
@require_admin_scope, the same guard as the terminal ticket: read-only API tokens, and the read-only profiles planned for later, can't see or run checks. The form also shows a "runs as root" warning.PR. One PR to
develop, unittest coverage, runtime templates in the 8 languages, UI strings in English and a docs section under Notifications. I'll test it on PVE 9.2.Does this overlap with the planned Addons work, or would you prefer anything done differently?
All reactions