nixos-config/modules/zabbix-agent.nix

22 lines
554 B
Nix
Raw Normal View History

2021-12-08 11:10:04 +01:00
{ pkgs, ... }:
2021-12-08 10:58:46 +01:00
{
services.zabbixAgent = {
enable = true;
server = "zabbix-server";
2021-12-08 11:10:04 +01:00
package = pkgs.zabbix.agent2;
settings = {
2022-02-19 11:47:17 +01:00
UserParameter = [
"systemd.exitstatus[*],systemctl show --value -p ExecMainStatus '$1'"
"borg.check[*],borg_check.sh '$1' '$2' '$3'"
];
};
2021-12-08 10:58:46 +01:00
};
2022-02-19 11:47:17 +01:00
systemd.services.zabbix-agent.path = [
(pkgs.writeShellScriptBin "borg_check.sh" (builtins.readFile ./borg_check.sh))
pkgs.gawk
];
users.users.zabbix-agent.extraGroups = [ "systemd-journal" ];
2021-12-08 10:58:46 +01:00
}
# vim: set et ts=2 sw=2 ai: