From e8d50f14185867d490f002aa5c408343ea5ea062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 19 Apr 2024 23:43:13 +0200 Subject: Factorize smartd monitoring --- systems/eldiron/flake.lock | 2 +- systems/eldiron/monitoring.nix | 38 ++++++-------------------------------- 2 files changed, 7 insertions(+), 33 deletions(-) (limited to 'systems/eldiron') diff --git a/systems/eldiron/flake.lock b/systems/eldiron/flake.lock index 461bebb..27d4d5b 100644 --- a/systems/eldiron/flake.lock +++ b/systems/eldiron/flake.lock @@ -2038,7 +2038,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", + "narHash": "sha256-Lpe56lKWhlMQiQoCgvMJuqJtJ8+szDldjqMAGyt2U3U=", "path": "../../flakes/private/monitoring", "type": "path" }, diff --git a/systems/eldiron/monitoring.nix b/systems/eldiron/monitoring.nix index 92da7cf..f3b9aeb 100644 --- a/systems/eldiron/monitoring.nix +++ b/systems/eldiron/monitoring.nix @@ -4,6 +4,12 @@ let emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check; in { + config.myServices.monitoring.smartdDisks = [ + "ata-ST33000650NS_Z29540DM" + "ata-ST33000650NS_Z296JGJ4" + "ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3" + ]; + config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary" "smartctl" ]; config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package; config.myServices.monitoring.objects = lib.mkMerge [ @@ -18,38 +24,6 @@ in { service = [ - { - service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z29540DM is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z29540DM" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z296JGJ4 is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z296JGJ4" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895 is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3 is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } { service_description = "No mdadm array is degraded"; use = "local-service"; -- cgit v1.2.3