nixos-config/modules/zabbix-agent.nix
2022-02-19 11:47:17 +01:00

21 lines
554 B
Nix

{ 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: