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/eldiron | |
parent | d1527470d38cfbd439c4da83c73ef68b02e9de9a (diff) | |
download | Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.tar.gz Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.tar.zst Nix-408ce9363bf574796487fedfe59a4a2ff0cbb4cb.zip |
Add monitoring script with smartctl
Diffstat (limited to 'systems/eldiron')
-rw-r--r-- | systems/eldiron/flake.lock | 2 | ||||
-rw-r--r-- | systems/eldiron/monitoring.nix | 34 |
2 files changed, 34 insertions, 2 deletions
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"]; |