{ pkgs, ... }: { services.zabbixAgent = { enable = true; server = "zabbix-server"; package = pkgs.zabbix.agent2; settings = { UserParameter = [ "systemd.exitstatus[*],systemctl show --value -p ExecMainStatus '$1'" "borg.check[*],borg_check.sh '$1' '$2' '$3'" ]; }; }; systemd.services.zabbix-agent.path = [ (pkgs.writeShellScriptBin "borg_check.sh" (builtins.readFile ./borg_check.sh)) pkgs.gawk ]; users.users.zabbix-agent.extraGroups = [ "systemd-journal" ]; } # vim: set et ts=2 sw=2 ai: