modularized docker health to gotify service
Check NixOS configurations / eval-hosts (push) Failing after 22m52s

This commit is contained in:
2026-07-13 01:29:45 +10:00
parent f541688973
commit 51fba54d94
3 changed files with 53 additions and 24 deletions
+25 -24
View File
@@ -27,7 +27,8 @@ in
../../modules/tailscale/enable-service.nix
../../modules/rotate-traefik-logs.nix
../../modules/raspi/mount-data.nix
../../modules/nextcloud-cron-job.nix
../../modules/services/nextcloud-cron-job.nix
../../modules/services/docker-health-to-gotify.nix
];
@@ -117,30 +118,30 @@ services.rpcbind.enable = true;
# Create Gotify Docker monitoring script task
systemd.services.docker-health-to-gotify = {
description = "Alert Gotify when Docker containers become unhealthy";
after = [ "docker.service" ];
serviceConfig = {
Type = "oneshot";
# Run as root so it can read /etc/secrets and access docker socket
# User = "root";
#EnvironmentFile = "-/etc/secrets/docker-health-alert.env";
ExecStart = "${pkgs.bash}/bin/bash /home/nixos/docker/monitoring/gotify/docker-health-to-gotify.sh";
StandardOutput = "journal";
StandardError = "journal";
};
path = with pkgs; [ docker curl coreutils gnused ];
};
# systemd.services.docker-health-to-gotify = {
# description = "Alert Gotify when Docker containers become unhealthy";
# after = [ "docker.service" ];
# serviceConfig = {
# Type = "oneshot";
# # Run as root so it can read /etc/secrets and access docker socket
# # User = "root";
# #EnvironmentFile = "-/etc/secrets/docker-health-alert.env";
# ExecStart = "${pkgs.bash}/bin/bash /home/nixos/docker/monitoring/gotify/docker-health-to-gotify.sh";
# StandardOutput = "journal";
# StandardError = "journal";
# };
# path = with pkgs; [ docker curl coreutils gnused ];
# };
systemd.timers.docker-health-to-gotify = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "2min";
OnUnitActiveSec = "1min";
AccuracySec = "15s";
Persistent = true;
};
};
# systemd.timers.docker-health-to-gotify = {
# wantedBy = [ "timers.target" ];
# timerConfig = {
# OnBootSec = "2min";
# OnUnitActiveSec = "1min";
# AccuracySec = "15s";
# Persistent = true;
# };
# };
systemd.tmpfiles.rules = [
# Create /mnt/docker