1
0

modules/backup: expose last backup time to monitoring

This commit is contained in:
clerie 2023-05-23 20:18:40 +02:00
parent 2205429088
commit 22bf25715e
2 changed files with 9 additions and 0 deletions

View File

@ -46,6 +46,8 @@ let
restic backup ${escapeShellArgs jobOptions.paths} restic backup ${escapeShellArgs jobOptions.paths}
restic check restic check
echo "clerie_backup_last_successful_run_time{backup_job=\"${jobName}\", backup_target=\"${targetName}\"} $(date +%s)" > /var/lib/prometheus-node-exporter/textfiles/clerie-backup-${jobName}-${targetName}.prom
''; '';
} }
) jobTargetPairs); ) jobTargetPairs);

View File

@ -66,8 +66,15 @@ in
enabledCollectors = [ enabledCollectors = [
"systemd" "systemd"
]; ];
extraFlags = [
"--collector.textfile.directory=/var/lib/prometheus-node-exporter/textfiles"
];
}; };
systemd.tmpfiles.rules = [
"d /var/lib/prometheus-node-exporter/textfiles - - - - -"
];
systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ]; systemd.services."prometheus-node-exporter".serviceConfig.RestrictAddressFamilies = [ "AF_NETLINK" ];
services.prometheus.exporters.bird = mkIf cfg.bird { services.prometheus.exporters.bird = mkIf cfg.bird {