X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fobjects_backup-2.nix;h=38b2ff696a6fac17c50e288425542399f8b74dfa;hb=791d00e6d4cc94080998c7516ff7b262369c6cfc;hp=b8ecb815bc7e89dfa58201db0b8c71a32b9f5a23;hpb=eb071dd42518cb40d629e5bde29c6aed72e4d4df;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 b8ecb81..38b2ff6 100644 --- a/modules/private/monitoring/objects_backup-2.nix +++ b/modules/private/monitoring/objects_backup-2.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, pkgs, ... }: { service = [ { @@ -17,14 +17,65 @@ check_command = ["check_last_file_date" "/backup2/immae_eu" "14" "backup"]; } { - service_description = "Last backup in /backup2/immae_fr is not too old"; + service_description = "Last backup in /backup2/ulminfo is not too old"; use = "local-service"; - check_command = ["check_last_file_date" "/backup2/immae_fr" "14" "backup"]; + check_command = ["check_last_file_date" "/backup2/ulminfo" "14" "backup"]; } { service_description = "Last postgresql dump in /backup2/eldiron/postgresql_backup is not too old"; use = "local-service"; check_command = ["check_last_file_date" "/backup2/eldiron/postgresql_backup" "7" "postgres"]; } + { + service_description = "Redis replication for eldiron is up to date"; + use = "local-service"; + check_command = ["check_redis_replication" "/run/redis_eldiron/redis.sock"]; + } + { + service_description = "Last redis dump in /backup2/eldiron/redis_backup is not too old"; + use = "local-service"; + check_command = ["check_last_file_date" "/backup2/eldiron/redis_backup" "7" "redis"]; + } + { + service_description = "Mysql replication for eldiron is up to date"; + use = "local-service"; + check_command = ["check_mysql_replication" "/run/mysqld_eldiron/mysqld.sock" "/var/secrets/mysql_replication/eldiron/client"]; + } + { + service_description = "Last mysql dump in /backup2/eldiron/mysql_backup is not too old"; + 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"]; + } ]; }