diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2024-04-13 12:39:31 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2024-04-13 12:44:20 +0200 |
commit | 408ce9363bf574796487fedfe59a4a2ff0cbb4cb (patch) | |
tree | 6085dd71a94e760d665be2a721a53302350c8e11 /systems | |
parent | d1527470d38cfbd439c4da83c73ef68b02e9de9a (diff) | |
download | Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.tar.gz Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.tar.zst Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.zip |
Add monitoring script with smartctl
Diffstat (limited to 'systems')
-rw-r--r-- | systems/backup-2/flake.lock | 2 | ||||
-rw-r--r-- | systems/dilion/flake.lock | 2 | ||||
-rw-r--r-- | systems/dilion/monitoring.nix | 34 | ||||
-rw-r--r-- | systems/eldiron/flake.lock | 2 | ||||
-rw-r--r-- | systems/eldiron/monitoring.nix | 34 | ||||
-rw-r--r-- | systems/monitoring-1/flake.lock | 2 | ||||
-rw-r--r-- | systems/quatresaisons/flake.lock | 2 |
7 files changed, 71 insertions, 7 deletions
diff --git a/systems/backup-2/flake.lock b/systems/backup-2/flake.lock index a8d55bf..d6e56a5 100644 --- a/systems/backup-2/flake.lock +++ b/systems/backup-2/flake.lock | |||
@@ -389,7 +389,7 @@ | |||
389 | }, | 389 | }, |
390 | "locked": { | 390 | "locked": { |
391 | "lastModified": 1, | 391 | "lastModified": 1, |
392 | "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=", | 392 | "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", |
393 | "path": "../../flakes/private/monitoring", | 393 | "path": "../../flakes/private/monitoring", |
394 | "type": "path" | 394 | "type": "path" |
395 | }, | 395 | }, |
diff --git a/systems/dilion/flake.lock b/systems/dilion/flake.lock index 3096384..a690504 100644 --- a/systems/dilion/flake.lock +++ b/systems/dilion/flake.lock | |||
@@ -207,7 +207,7 @@ | |||
207 | }, | 207 | }, |
208 | "locked": { | 208 | "locked": { |
209 | "lastModified": 1, | 209 | "lastModified": 1, |
210 | "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=", | 210 | "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", |
211 | "path": "../../flakes/private/monitoring", | 211 | "path": "../../flakes/private/monitoring", |
212 | "type": "path" | 212 | "type": "path" |
213 | }, | 213 | }, |
diff --git a/systems/dilion/monitoring.nix b/systems/dilion/monitoring.nix index af7f224..5c4e5b0 100644 --- a/systems/dilion/monitoring.nix +++ b/systems/dilion/monitoring.nix | |||
@@ -9,7 +9,7 @@ let | |||
9 | }; | 9 | }; |
10 | in | 10 | in |
11 | { | 11 | { |
12 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary"]; | 12 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary" "smartctl" ]; |
13 | config.myServices.monitoring.objects = lib.mkMerge [ | 13 | config.myServices.monitoring.objects = lib.mkMerge [ |
14 | (monitoring.lib.objectsCommon { | 14 | (monitoring.lib.objectsCommon { |
15 | inherit hostFQDN; | 15 | inherit hostFQDN; |
@@ -23,6 +23,38 @@ in | |||
23 | { | 23 | { |
24 | service = [ | 24 | service = [ |
25 | { | 25 | { |
26 | service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B is sane"; | ||
27 | use = "local-service"; | ||
28 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A4B" ]; | ||
29 | __passive_servicegroups = "webstatus-resources"; | ||
30 | |||
31 | check_interval = 60; | ||
32 | } | ||
33 | { | ||
34 | service_description = "Disk /dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70 is sane"; | ||
35 | use = "local-service"; | ||
36 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_1100_MTFDDAK512TBN_171216BD2A70" ]; | ||
37 | __passive_servicegroups = "webstatus-resources"; | ||
38 | |||
39 | check_interval = 60; | ||
40 | } | ||
41 | { | ||
42 | service_description = "Disk /dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC is sane"; | ||
43 | use = "local-service"; | ||
44 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-TOSHIBA_MG04ACA400N_96K1K87YFVLC" ]; | ||
45 | __passive_servicegroups = "webstatus-resources"; | ||
46 | |||
47 | check_interval = 60; | ||
48 | } | ||
49 | { | ||
50 | service_description = "Disk /dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP is sane"; | ||
51 | use = "local-service"; | ||
52 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-WDC_WD3000FYYZ-01UL1B2_WD-WMC1F0E4X6WP" ]; | ||
53 | __passive_servicegroups = "webstatus-resources"; | ||
54 | |||
55 | check_interval = 60; | ||
56 | } | ||
57 | { | ||
26 | service_description = "No mdadm array is degraded"; | 58 | service_description = "No mdadm array is degraded"; |
27 | use = "local-service"; | 59 | use = "local-service"; |
28 | check_command = ["check_mdadm"]; | 60 | check_command = ["check_mdadm"]; |
diff --git a/systems/eldiron/flake.lock b/systems/eldiron/flake.lock index f5b9184..461bebb 100644 --- a/systems/eldiron/flake.lock +++ b/systems/eldiron/flake.lock | |||
@@ -2038,7 +2038,7 @@ | |||
2038 | }, | 2038 | }, |
2039 | "locked": { | 2039 | "locked": { |
2040 | "lastModified": 1, | 2040 | "lastModified": 1, |
2041 | "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=", | 2041 | "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", |
2042 | "path": "../../flakes/private/monitoring", | 2042 | "path": "../../flakes/private/monitoring", |
2043 | "type": "path" | 2043 | "type": "path" |
2044 | }, | 2044 | }, |
diff --git a/systems/eldiron/monitoring.nix b/systems/eldiron/monitoring.nix index 2aa7f8f..92da7cf 100644 --- a/systems/eldiron/monitoring.nix +++ b/systems/eldiron/monitoring.nix | |||
@@ -4,7 +4,7 @@ let | |||
4 | emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check; | 4 | emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check; |
5 | in | 5 | in |
6 | { | 6 | { |
7 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary"]; | 7 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary" "smartctl" ]; |
8 | config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package; | 8 | config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package; |
9 | config.myServices.monitoring.objects = lib.mkMerge [ | 9 | config.myServices.monitoring.objects = lib.mkMerge [ |
10 | (monitoring.lib.objectsCommon { | 10 | (monitoring.lib.objectsCommon { |
@@ -19,6 +19,38 @@ in | |||
19 | { | 19 | { |
20 | service = [ | 20 | service = [ |
21 | { | 21 | { |
22 | service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z29540DM is sane"; | ||
23 | use = "local-service"; | ||
24 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z29540DM" ]; | ||
25 | __passive_servicegroups = "webstatus-resources"; | ||
26 | |||
27 | check_interval = 60; | ||
28 | } | ||
29 | { | ||
30 | service_description = "Disk /dev/disk/by-id/ata-ST33000650NS_Z296JGJ4 is sane"; | ||
31 | use = "local-service"; | ||
32 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-ST33000650NS_Z296JGJ4" ]; | ||
33 | __passive_servicegroups = "webstatus-resources"; | ||
34 | |||
35 | check_interval = 60; | ||
36 | } | ||
37 | { | ||
38 | service_description = "Disk /dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895 is sane"; | ||
39 | use = "local-service"; | ||
40 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-SAMSUNG_MZ7LM480HMHQ-00005_S2UJNX0HA05895" ]; | ||
41 | __passive_servicegroups = "webstatus-resources"; | ||
42 | |||
43 | check_interval = 60; | ||
44 | } | ||
45 | { | ||
46 | service_description = "Disk /dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3 is sane"; | ||
47 | use = "local-service"; | ||
48 | check_command = [ "check_smartctl" "/dev/disk/by-id/ata-Micron_5200_MTFDDAK480TDC_18011BEE03B3" ]; | ||
49 | __passive_servicegroups = "webstatus-resources"; | ||
50 | |||
51 | check_interval = 60; | ||
52 | } | ||
53 | { | ||
22 | service_description = "No mdadm array is degraded"; | 54 | service_description = "No mdadm array is degraded"; |
23 | use = "local-service"; | 55 | use = "local-service"; |
24 | check_command = ["check_mdadm"]; | 56 | check_command = ["check_mdadm"]; |
diff --git a/systems/monitoring-1/flake.lock b/systems/monitoring-1/flake.lock index ed711f4..643683a 100644 --- a/systems/monitoring-1/flake.lock +++ b/systems/monitoring-1/flake.lock | |||
@@ -277,7 +277,7 @@ | |||
277 | }, | 277 | }, |
278 | "locked": { | 278 | "locked": { |
279 | "lastModified": 1, | 279 | "lastModified": 1, |
280 | "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=", | 280 | "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", |
281 | "path": "../../flakes/private/monitoring", | 281 | "path": "../../flakes/private/monitoring", |
282 | "type": "path" | 282 | "type": "path" |
283 | }, | 283 | }, |
diff --git a/systems/quatresaisons/flake.lock b/systems/quatresaisons/flake.lock index a76103c..afb007b 100644 --- a/systems/quatresaisons/flake.lock +++ b/systems/quatresaisons/flake.lock | |||
@@ -239,7 +239,7 @@ | |||
239 | }, | 239 | }, |
240 | "locked": { | 240 | "locked": { |
241 | "lastModified": 1, | 241 | "lastModified": 1, |
242 | "narHash": "sha256-PicwNqwQaCKtN5zPpTfpSDRXbyn9xh8aHqoPnm9cFz8=", | 242 | "narHash": "sha256-A50vXg0qfzUhyQZKToEseYsLgtaYke41KE/4uuyj+PY=", |
243 | "path": "../../flakes/private/monitoring", | 243 | "path": "../../flakes/private/monitoring", |
244 | "type": "path" | 244 | "type": "path" |
245 | }, | 245 | }, |