diff options
Diffstat (limited to 'modules/private/monitoring/objects_backup-2.nix')
-rw-r--r-- | modules/private/monitoring/objects_backup-2.nix | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/modules/private/monitoring/objects_backup-2.nix b/modules/private/monitoring/objects_backup-2.nix index c302e45..2b80eee 100644 --- a/modules/private/monitoring/objects_backup-2.nix +++ b/modules/private/monitoring/objects_backup-2.nix | |||
@@ -1,4 +1,4 @@ | |||
1 | { ... }: | 1 | { config, pkgs, ... }: |
2 | { | 2 | { |
3 | service = [ | 3 | service = [ |
4 | { | 4 | { |
@@ -46,5 +46,36 @@ | |||
46 | use = "local-service"; | 46 | use = "local-service"; |
47 | check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"]; | 47 | check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"]; |
48 | } | 48 | } |
49 | { | ||
50 | service_description = "Openldap replication for eldiron is up to date"; | ||
51 | use = "local-service"; | ||
52 | check_command = let | ||
53 | name = "eldiron"; | ||
54 | hcfg = config.myServices.databasesReplication.openldap.hosts.eldiron; | ||
55 | base = config.myServices.databasesReplication.openldap.base; | ||
56 | eldiron_schemas = pkgs.callPackage ../databases/openldap/eldiron_schemas.nix {}; | ||
57 | ldapConfig = pkgs.writeText "slapd.conf" '' | ||
58 | ${eldiron_schemas} | ||
59 | moduleload back_hdb | ||
60 | backend hdb | ||
61 | database hdb | ||
62 | |||
63 | suffix "${hcfg.base}" | ||
64 | directory ${base}/${name}/openldap | ||
65 | ''; | ||
66 | in [ | ||
67 | "check_openldap_replication" | ||
68 | hcfg.url | ||
69 | hcfg.dn | ||
70 | "${config.secrets.location}/openldap_replication/eldiron/replication_password" | ||
71 | hcfg.base | ||
72 | ldapConfig | ||
73 | ]; | ||
74 | } | ||
75 | { | ||
76 | service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old"; | ||
77 | use = "local-service"; | ||
78 | check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"]; | ||
79 | } | ||
49 | ]; | 80 | ]; |
50 | } | 81 | } |