1 { config, pkgs, lib, name, openldap, monitoring, ... }:
3 hostFQDN = config.hostEnv.fqdn;
4 emailCheck = monitoring.lib.emailCheck config.myEnv.monitoring.email_check;
7 config.myServices.monitoring.activatedPlugins = [ "memory" "command" "bandwidth" "file_date" "mysql" "openldap" "redis" "emails" "notify-secondary"];
8 config.myServices.monitoring.objects = lib.mkMerge [
9 (monitoring.lib.objectsCommon {
13 processWarn = "60"; processAlert = "70";
14 loadWarn = "4.0"; loadAlert = "6.0";
15 load15Warn = "1.0"; load15Alert = "1.0";
16 interface = builtins.head (builtins.attrNames config.networking.interfaces);
21 (emailCheck "backup-2" hostFQDN // {
22 __passive_servicegroups = "webstatus-email";
25 service_description = "Size on /backup2 partition";
26 use = "local-service";
27 check_command = ["check_local_disk" "10%" "5%" "/backup2"];
28 __passive_servicegroups = "webstatus-resources";
31 service_description = "Last backup in /backup2/phare is not too old";
32 use = "local-service";
33 check_command = ["check_last_file_date" "/backup2/phare" "14" "backup"];
34 __passive_servicegroups = "webstatus-backup";
37 service_description = "Last backup in /backup2/dilion is not too old";
38 use = "local-service";
39 check_command = ["check_last_file_date" "/backup2/dilion" "14" "backup"];
40 __passive_servicegroups = "webstatus-backup";
43 service_description = "Last backup in /backup2/ulminfo is not too old";
44 use = "local-service";
45 check_command = ["check_last_file_date" "/backup2/ulminfo" "14" "backup"];
46 __passive_servicegroups = "webstatus-backup";
49 service_description = "Last postgresql dump in /backup2/eldiron/postgresql_backup is not too old";
50 use = "local-service";
51 check_command = ["check_last_file_date" "/backup2/eldiron/postgresql_backup" "7" "postgres"];
52 __passive_servicegroups = "webstatus-databases,webstatus-backup";
55 service_description = "Redis replication for eldiron is up to date";
56 use = "local-service";
57 check_command = ["check_redis_replication" "/run/redis_eldiron/redis.sock"];
58 __passive_servicegroups = "webstatus-databases";
61 service_description = "Last redis dump in /backup2/eldiron/redis_backup is not too old";
62 use = "local-service";
63 check_command = ["check_last_file_date" "/backup2/eldiron/redis_backup" "7" "redis"];
64 __passive_servicegroups = "webstatus-databases,webstatus-backup";
67 service_description = "Mysql replication for eldiron is up to date";
68 use = "local-service";
69 check_command = ["check_mysql_replication" "/run/mysqld_eldiron/mysqld.sock" config.secrets.fullPaths."mysql_replication/eldiron/client"];
70 __passive_servicegroups = "webstatus-databases";
73 service_description = "Last mysql dump in /backup2/eldiron/mysql_backup is not too old";
74 use = "local-service";
75 check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"];
76 __passive_servicegroups = "webstatus-databases,webstatus-backup";
79 service_description = "Openldap replication for eldiron is up to date";
80 use = "local-service";
83 hcfg = config.myServices.databasesReplication.openldap.hosts.eldiron;
84 base = config.myServices.databasesReplication.openldap.base;
85 ldapConfig = pkgs.writeText "slapd.conf" ''
86 include ${pkgs.openldap}/etc/schema/core.schema
87 include ${pkgs.openldap}/etc/schema/cosine.schema
88 include ${pkgs.openldap}/etc/schema/inetorgperson.schema
89 include ${pkgs.openldap}/etc/schema/nis.schema
90 include ${openldap.immae-schema}
96 directory ${base}/${name}/openldap
99 "check_openldap_replication"
102 config.secrets.fullPaths."openldap_replication/eldiron/replication_password"
106 __passive_servicegroups = "webstatus-databases";
109 service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old";
110 use = "local-service";
111 check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"];
112 __passive_servicegroups = "webstatus-databases,webstatus-backup";