monitoring: build fs list from config
This commit is contained in:
parent
ae835019bd
commit
7db769a19a
@ -1,6 +1,9 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (builtins)
|
||||
readFile concatStringsSep attrValues mapAttrs replaceStrings;
|
||||
|
||||
{
|
||||
in {
|
||||
config = {
|
||||
sops.secrets = {
|
||||
monit_cfg = {
|
||||
@ -11,7 +14,12 @@
|
||||
};
|
||||
services.monit = {
|
||||
enable = true;
|
||||
config = builtins.readFile ./monitrc;
|
||||
config = readFile ./monitrc + (concatStringsSep "\n" (attrValues (mapAttrs
|
||||
(f: _: ''
|
||||
check filesystem ${replaceStrings [ "/" ] [ "_" ] f} with path ${f}
|
||||
if space usage > 90% then alert
|
||||
if inode usage > 90% then alert
|
||||
'') config.fileSystems)));
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -20,6 +20,3 @@ check system $HOST
|
||||
if cpu usage (wait) > 80% for 2 cycles then alert
|
||||
if cpu usage > 200% for 4 cycles then alert
|
||||
|
||||
check filesystem rootfs with path /
|
||||
if space usage > 90% then alert
|
||||
if inode usage > 90% then alert
|
||||
|
Loading…
Reference in New Issue
Block a user