X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fprivate%2Fmonitoring%2Fobjects_backup-2.nix;h=2b80eee96f4643fbe836ccdc6aa7b48f917acb91;hb=16b80abd57bb215d0e72f3983f997a007743b8fb;hp=c302e453f08663f74fa26514beb688074e9bc914;hpb=6015a3b52c3b155ac444aeb39950c38a5e653101;p=perso%2FImmae%2FConfig%2FNix.git 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 @@ -{ ... }: +{ config, pkgs, ... }: { service = [ { @@ -46,5 +46,36 @@ use = "local-service"; check_command = ["check_last_file_date" "/backup2/eldiron/mysql_backup" "7" "mysql"]; } + { + service_description = "Openldap replication for eldiron is up to date"; + use = "local-service"; + check_command = let + name = "eldiron"; + hcfg = config.myServices.databasesReplication.openldap.hosts.eldiron; + base = config.myServices.databasesReplication.openldap.base; + eldiron_schemas = pkgs.callPackage ../databases/openldap/eldiron_schemas.nix {}; + ldapConfig = pkgs.writeText "slapd.conf" '' + ${eldiron_schemas} + moduleload back_hdb + backend hdb + database hdb + + suffix "${hcfg.base}" + directory ${base}/${name}/openldap + ''; + in [ + "check_openldap_replication" + hcfg.url + hcfg.dn + "${config.secrets.location}/openldap_replication/eldiron/replication_password" + hcfg.base + ldapConfig + ]; + } + { + service_description = "Last openldap dump in /backup2/eldiron/openldap_backup is not too old"; + use = "local-service"; + check_command = ["check_last_file_date" "/backup2/eldiron/openldap_backup" "7" "openldap"]; + } ]; }