06858e34bb
A bare 'sensors -u | grep -m1 temp1_input' can match a non-CPU chip's temp1_input first (e.g. acpitz case temp 27.8 vs coretemp 46.0), so the rule silently never fires. Example in config/event.env and howto now target coretemp-isa-0000 + 'Package id 0' explicitly; howto notes the gotcha.
22 lines
1.0 KiB
Bash
22 lines
1.0 KiB
Bash
# eventer rules — evaluated by 'pos system event-trigger run' (systemd timer).
|
|
# Copied to ~/.config/linux_post_install/event.env on install (no clobber).
|
|
# One independent rule per line. Grammar:
|
|
#
|
|
# "<message>" if <check-command> <op> <threshold>
|
|
# <check-command> <op> <threshold> (no message → auto-composed)
|
|
#
|
|
# The check command is run; its first numeric output is compared against the
|
|
# threshold (float-safe, unit suffix on the threshold is fine: 60c, 80%, 10g).
|
|
# Operators: > < >= <= == !=
|
|
#
|
|
# Rules alert once on false→true (plus one recovery message when the
|
|
# condition clears) via lib/notify.sh — Telegram by default.
|
|
#
|
|
# Examples:
|
|
# "CPU too hot" if sensors -u coretemp-isa-0000 | awk '/Package id 0:/{f=1} f && /temp1_input:/{print $2; exit}' > 60c
|
|
# "Disk nearly full" if df -P / | awk 'NR==2{print $5+0}' > 80%
|
|
# "Load high" if uptime | sed 's/.*load average: //; s/,.*//' >= 4
|
|
#
|
|
# Manage rules interactively: pos system event-trigger config
|
|
# Schedule the timer: pos system event-trigger enable 5m
|