add ups periodic checks

This commit is contained in:
Alex Tau 2025-09-13 14:40:02 +03:00
parent 09eabcc6b2
commit da480a7c4e
13 changed files with 533 additions and 403 deletions

View file

@ -76,6 +76,10 @@ package:
warning_threshold_comb_bytes = interfaceCfg.warningThresholdCombBytes;
critical_threshold_comb_bytes = interfaceCfg.criticalThresholdCombBytes;
}) cfg.checks.net.interfaces;
ups = with cfg.checks.ups; {
ups_to_check = upsToCheck;
};
};
};
in lib.mkIf cfg.enable {

View file

@ -33,6 +33,7 @@ in
"ram"
"temp"
"net"
"ups"
"vulnix"
]);
@ -45,6 +46,7 @@ in
* ram -- alerts when RAM usage is above threshold
* temp -- alerts when temperature readings are above thresholds
* net -- alerts when network usage is above threshold
* ups -- alerts on UPS events
* vulnix -- periodically scans system for known CVEs, alerts if any are found (NixOS only)'';
};
@ -170,6 +172,14 @@ in
}'';
};
};
ups = {
upsToCheck = lib.mkOption {
type = with lib.types; nullOr (listOf str);
default = null;
description = "List of UPS's to monitor, in `upsc`-compatible format. If null, all UPS's connected to localhost are checked.";
};
};
};
};
}