aboutsummaryrefslogtreecommitdiff
path: root/systems/eldiron/monitoring.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /systems/eldiron/monitoring.nix
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-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/eldiron/monitoring.nix')
-rw-r--r--systems/eldiron/monitoring.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/systems/eldiron/monitoring.nix b/systems/eldiron/monitoring.nix
new file mode 100644
index 0000000..2aa7f8f
--- /dev/null
+++ b/systems/eldiron/monitoring.nix
@@ -0,0 +1,51 @@
1{ config, pkgs, lib, name, monitoring, ... }:
2let
3 hostFQDN = config.hostEnv.fqdn;
4 emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check;
5in
6{
7 config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "emails" "mdadm" "postfix" "postgresql" "zfs" "notify-secondary"];
8 config.myServices.monitoring.pluginsArgs.postgresql.package = config.myServices.databases.postgresql.package;
9 config.myServices.monitoring.objects = lib.mkMerge [
10 (monitoring.lib.objectsCommon {
11 inherit hostFQDN;
12 hostName = name;
13 master = false;
14 processWarn = "550"; processAlert = "650";
15 loadWarn = "1.0"; loadAlert = "1.2";
16 interface = builtins.head (builtins.attrNames config.networking.interfaces);
17 })
18
19 {
20 service = [
21 {
22 service_description = "No mdadm array is degraded";
23 use = "local-service";
24 check_command = ["check_mdadm"];
25 __passive_servicegroups = "webstatus-resources";
26 }
27 {
28 service_description = "Postgresql replication for backup-2 is up to date";
29 use = "local-service";
30 check_command = ["check_postgresql_replication" "backup-2" "/run/postgresql" "5432"];
31 __passive_servicegroups = "webstatus-databases";
32 }
33 {
34 service_description = "No ZFS pool is degraded";
35 use = "local-service";
36 check_command = ["check_zfs"];
37 __passive_servicegroups = "webstatus-resources";
38 }
39 {
40 service_description = "mailq is empty";
41 use = "local-service";
42 check_command = ["check_mailq"];
43 __passive_servicegroups = "webstatus-email";
44 }
45 (emailCheck "eldiron" hostFQDN // {
46 __passive_servicegroups = "webstatus-email";
47 })
48 ];
49 }
50 ];
51}