network monitoring

This commit is contained in:
Alex Tau 2025-06-07 15:59:05 +03:00
parent 8af7b683b6
commit 8b18d407d7
21 changed files with 434 additions and 53 deletions

View file

@ -60,6 +60,15 @@ package:
warning_percentage = warningPercentage;
critical_percentage = criticalPercentage;
};
net.interfaces = lib.mapAttrs (_: interfaceCfg: {
warning_threshold_sent_bytes = interfaceCfg.warningThresholdSentBytes;
critical_threshold_sent_bytes = interfaceCfg.criticalThresholdSentBytes;
warning_threshold_recv_bytes = interfaceCfg.warningThresholdRecvBytes;
critical_threshold_recv_bytes = interfaceCfg.warningThresholdRecvBytes;
warning_threshold_comb_bytes = interfaceCfg.warningThresholdCombBytes;
critical_threshold_comb_bytes = interfaceCfg.criticalThresholdCombBytes;
}) cfg.checks.net.interfaces;
};
};
in lib.mkIf cfg.enable {