]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/monitoring/objects_common.nix
Adjust monitoring resources and add bandwidth checks
[perso/Immae/Config/Nix.git] / modules / private / monitoring / objects_common.nix
index c0a17e66684bd7c75be3ea03f42158fbf8c49233..d3a46ce06a9ac1a6233affcac3b4d995e1a1893d 100644 (file)
@@ -1,5 +1,6 @@
 { hostFQDN
 , hostName
+, interface ? "eth0"
 , processWarn ? "250"
 , processAlert ? "400"
 , loadWarn ? "8.0"
@@ -49,6 +50,20 @@ in
         "RSZDT"
       ];
     }
+    {
+      passiveInfo = defaultPassiveInfo;
+      service_description = "Network bandwidth";
+      use = "local-service";
+      check_interval = "2";
+      max_check_attempts = "20";
+      retry_interval = "2";
+      check_command = [
+        "check_local_bandwidth"
+        interface
+        "20480" # kb/s
+        "51200" # kb/s
+      ];
+    }
     {
       passiveInfo = defaultPassiveInfo;
       service_description = "Average load";
@@ -108,6 +123,7 @@ in
     check_local_procs = "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$";
     check_local_load = "$USER1$/check_load -w $ARG1$ -c $ARG2$";
     check_local_swap = "$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$";
+    check_local_bandwidth = "$USER2$/check_bandwidth -i=$ARG1$ -w $ARG2$ -c $ARG3$";
     check_memory = "$USER2$/check_mem.sh -w $ARG1$ -c $ARG2$";
     check_command_match = "$USER2$/check_command -c \"$ARG1$\" -C \"$ARG2$\" $ARG3$";
     check_command_output = "$USER2$/check_command -c \"$ARG1$\" -s 0 -o \"$ARG2$\" $ARG3$";