]>
Commit | Line | Data |
---|---|---|
1 | { lib, pkgs, config, name, monitoring, ... }: | |
2 | let | |
3 | hostFQDN = config.hostEnv.fqdn; | |
4 | zfs_snapshot = name: { | |
5 | service_description = "ZFS snapshot ${name} happened not too long ago"; | |
6 | use = "local-service"; | |
7 | check_command = ["check_zfs_snapshot" name]; | |
8 | __passive_servicegroups = "webstatus-resources"; | |
9 | }; | |
10 | in | |
11 | { | |
12 | config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "mdadm" "zfs" "notify-secondary" "smartctl" ]; | |
13 | config.myServices.monitoring.objects = lib.mkMerge [ | |
14 | (monitoring.lib.objectsCommon { | |
15 | inherit hostFQDN; | |
16 | hostName = name; | |
17 | master = false; | |
18 | processWarn = "250"; processAlert = "400"; | |
19 | loadWarn = "1.0"; loadAlert = "1.2"; | |
20 | interface = builtins.head (builtins.attrNames config.networking.interfaces); | |
21 | }) | |
22 | ||
23 | { | |
24 | service = [ | |
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 | { | |
58 | service_description = "No mdadm array is degraded"; | |
59 | use = "local-service"; | |
60 | check_command = ["check_mdadm"]; | |
61 | __passive_servicegroups = "webstatus-resources"; | |
62 | } | |
63 | { | |
64 | service_description = "No ZFS pool is degraded"; | |
65 | use = "local-service"; | |
66 | check_command = ["check_zfs"]; | |
67 | __passive_servicegroups = "webstatus-resources"; | |
68 | } | |
69 | (zfs_snapshot "zpool/backup/eldiron/zpool/root") | |
70 | (zfs_snapshot "zpool/backup/eldiron/zpool/root/etc") | |
71 | (zfs_snapshot "zpool/backup/eldiron/zpool/root/var") | |
72 | ]; | |
73 | } | |
74 | ]; | |
75 | } |