Monitor all failed units

This commit is contained in:
Paul-Henri Froidmont 2022-11-07 03:45:17 +01:00
parent 85ae50d263
commit d493a25329
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE

View file

@ -42,6 +42,9 @@ in
set mail-format { from: monit@banditlair.com } set mail-format { from: monit@banditlair.com }
set alert alerts@banditlair.com with reminder on 120 cycles set alert alerts@banditlair.com with reminder on 120 cycles
check program failed-untis with path "${pkgs.systemd}/bin/systemctl --failed"
if content != "0 loaded units listed" then alert
check system $HOST check system $HOST
if cpu usage > 95% for 10 cycles then alert if cpu usage > 95% for 10 cycles then alert
if memory usage > 75% for 5 times within 15 cycles then alert if memory usage > 75% for 5 times within 15 cycles then alert