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/backup-2/flake.lock | 2 +- systems/dilion/flake.lock | 2 +- systems/dilion/monitoring.nix | 38 ++++++-------------------------------- systems/eldiron/flake.lock | 2 +- systems/eldiron/monitoring.nix | 38 ++++++-------------------------------- systems/monitoring-1/flake.lock | 2 +- systems/quatresaisons/flake.lock | 2 +- 7 files changed, 17 insertions(+), 69 deletions(-) (limited to 'systems') diff --git a/systems/backup-2/flake.lock b/systems/backup-2/flake.lock index d6e56a5..7d5992e 100644 --- a/systems/backup-2/flake.lock +++ b/systems/backup-2/flake.lock @@ -389,7 +389,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", + "narHash": "sha256-Lpe56lKWhlMQiQoCgvMJuqJtJ8+szDldjqMAGyt2U3U=", "path": "../../flakes/private/monitoring", "type": "path" }, diff --git a/systems/dilion/flake.lock b/systems/dilion/flake.lock index a690504..ce8bb8f 100644 --- a/systems/dilion/flake.lock +++ b/systems/dilion/flake.lock @@ -207,7 +207,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", + "narHash": "sha256-Lpe56lKWhlMQiQoCgvMJuqJtJ8+szDldjqMAGyt2U3U=", "path": "../../flakes/private/monitoring", "type": "path" }, diff --git a/systems/dilion/monitoring.nix b/systems/dilion/monitoring.nix index 5c4e5b0..e45aa25 100644 --- a/systems/dilion/monitoring.nix +++ b/systems/dilion/monitoring.nix @@ -9,6 +9,12 @@ let }; in { + config.myServices.monitoring.smartdDisks = [ + "ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B" + "ata-Micron_1100_MTFDDAK512TBN_171216BD2A70" + "ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC" + "ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP" + ]; config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary" "smartctl" ]; config.myServices.monitoring.objects = lib.mkMerge [ (monitoring.lib.objectsCommon { @@ -22,38 +28,6 @@ in { service = [ - { - service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70 is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } - { - service_description = "Disk /dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP is sane"; - use = "local-service"; - check_command = [ "check_smartctl" "/dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP" ]; - __passive_servicegroups = "webstatus-resources"; - - check_interval = 60; - } { service_description = "No mdadm array is degraded"; use = "local-service"; 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"; diff --git a/systems/monitoring-1/flake.lock b/systems/monitoring-1/flake.lock index 643683a..c69d09a 100644 --- a/systems/monitoring-1/flake.lock +++ b/systems/monitoring-1/flake.lock @@ -277,7 +277,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", + "narHash": "sha256-Lpe56lKWhlMQiQoCgvMJuqJtJ8+szDldjqMAGyt2U3U=", "path": "../../flakes/private/monitoring", "type": "path" }, diff --git a/systems/quatresaisons/flake.lock b/systems/quatresaisons/flake.lock index afb007b..4cb49da 100644 --- a/systems/quatresaisons/flake.lock +++ b/systems/quatresaisons/flake.lock @@ -239,7 +239,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", + "narHash": "sha256-Lpe56lKWhlMQiQoCgvMJuqJtJ8+szDldjqMAGyt2U3U=", "path": "../../flakes/private/monitoring", "type": "path" }, -- cgit v1.2.3