1 { config, pkgs, lib, hostFQDN, emailCheck, ... }:
4 filter = lib.attrsets.filterAttrs
5 (k: v: builtins.elem k ["service_description"] || builtins.substring 0 1 k == "_");
6 use = "external-passive-service";
7 freshness_threshold = "450";
9 servicegroups = "webstatus-resources";
15 (emailCheck "backup-2" hostFQDN // {
16 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-email"; freshness_threshold = "1350"; };
19 passiveInfo = defaultPassiveInfo;
20 service_description = "Size on /backup2 partition";
21 use = "local-service";
22 check_command = ["check_local_disk" "10%" "5%" "/backup2"];
25 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; };
26 service_description = "Last backup in /backup2/phare is not too old";
27 use = "local-service";
28 check_command = ["check_last_file_date" "/backup2/phare" "14" "backup"];
31 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; };
32 service_description = "Last backup in /backup2/dilion is not too old";
33 use = "local-service";
34 check_command = ["check_last_file_date" "/backup2/dilion" "14" "backup"];
37 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-backup"; };
38 service_description = "Last backup in /backup2/ulminfo is not too old";
39 use = "local-service";
40 check_command = ["check_last_file_date" "/backup2/ulminfo" "14" "backup"];
43 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; };
44 service_description = "Last postgresql dump in /backup2/eldiron/postgresql_backup is not too old";
45 use = "local-service";
46 check_command = ["check_last_file_date" "/backup2/eldiron/postgresql_backup" "7" "postgres"];
49 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
50 service_description = "Redis replication for eldiron is up to date";
51 use = "local-service";
52 check_command = ["check_redis_replication" "/run/redis_eldiron/redis.sock"];
55 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; };
56 service_description = "Last redis dump in /backup2/eldiron/redis_backup is not too old";
57 use = "local-service";
58 check_command = ["check_last_file_date" "/backup2/eldiron/redis_backup" "7" "redis"];
61 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
62 service_description = "Mysql replication for eldiron is up to date";
63 use = "local-service";
64 check_command = ["check_mysql_replication" "/run/mysqld_eldiron/mysqld.sock" "/var/secrets/mysql_replication/eldiron/client"];
67 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; };
68 service_description = "Last mysql dump in /backup2/eldiron/mysql_backup is not too old";
69 use = "local-service";
70 check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"];
73 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases"; };
74 service_description = "Openldap replication for eldiron is up to date";
75 use = "local-service";
78 hcfg = config.myServices.databasesReplication.openldap.hosts.eldiron;
79 base = config.myServices.databasesReplication.openldap.base;
80 eldiron_schemas = pkgs.callPackage ../databases/openldap/eldiron_schemas.nix {};
81 ldapConfig = pkgs.writeText "slapd.conf" ''
82 include ${pkgs.openldap}/etc/schema/core.schema
83 include ${pkgs.openldap}/etc/schema/cosine.schema
84 include ${pkgs.openldap}/etc/schema/inetorgperson.schema
85 include ${pkgs.openldap}/etc/schema/nis.schema
92 directory ${base}/${name}/openldap
95 "check_openldap_replication"
98 "${config.secrets.location}/openldap_replication/eldiron/replication_password"
104 passiveInfo = defaultPassiveInfo // { servicegroups = "webstatus-databases,webstatus-backup"; };
105 service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old";
106 use = "local-service";
107 check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"];