diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /systems/dilion/monitoring.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'systems/dilion/monitoring.nix')
-rw-r--r-- | systems/dilion/monitoring.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/systems/dilion/monitoring.nix b/systems/dilion/monitoring.nix new file mode 100644 index 0000000..af7f224 --- /dev/null +++ b/systems/dilion/monitoring.nix | |||
@@ -0,0 +1,43 @@ | |||
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"]; | ||
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 = "No mdadm array is degraded"; | ||
27 | use = "local-service"; | ||
28 | check_command = ["check_mdadm"]; | ||
29 | __passive_servicegroups = "webstatus-resources"; | ||
30 | } | ||
31 | { | ||
32 | service_description = "No ZFS pool is degraded"; | ||
33 | use = "local-service"; | ||
34 | check_command = ["check_zfs"]; | ||
35 | __passive_servicegroups = "webstatus-resources"; | ||
36 | } | ||
37 | (zfs_snapshot "zpool/backup/eldiron/zpool/root") | ||
38 | (zfs_snapshot "zpool/backup/eldiron/zpool/root/etc") | ||
39 | (zfs_snapshot "zpool/backup/eldiron/zpool/root/var") | ||
40 | ]; | ||
41 | } | ||
42 | ]; | ||
43 | } | ||