aboutsummaryrefslogtreecommitdiff
path: root/modules/private/monitoring/objects_backup-2.nix
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-12-08 16:22:56 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-12-08 16:22:56 +0100
commit16b80abd57bb215d0e72f3983f997a007743b8fb (patch)
tree19b24a9c9e2334c069721671e4e2a5d53d8efaec /modules/private/monitoring/objects_backup-2.nix
parent6015a3b52c3b155ac444aeb39950c38a5e653101 (diff)
downloadNix-16b80abd57bb215d0e72f3983f997a007743b8fb.tar.gz
Nix-16b80abd57bb215d0e72f3983f997a007743b8fb.tar.zst
Nix-16b80abd57bb215d0e72f3983f997a007743b8fb.zip
Add openldap replication
Diffstat (limited to 'modules/private/monitoring/objects_backup-2.nix')
-rw-r--r--modules/private/monitoring/objects_backup-2.nix33
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}