From d493a25329c4f1eb82449043c75d79619aa90a78 Mon Sep 17 00:00:00 2001 From: Paul-Henri Froidmont Date: Mon, 7 Nov 2022 03:45:17 +0100 Subject: [PATCH] Monitor all failed units --- modules/monit.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/monit.nix b/modules/monit.nix index adae29d..42cba30 100644 --- a/modules/monit.nix +++ b/modules/monit.nix @@ -42,6 +42,9 @@ in set mail-format { from: monit@banditlair.com } 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 if cpu usage > 95% for 10 cycles then alert if memory usage > 75% for 5 times within 15 cycles then alert