nixos/zabbixAgent: add a few minor tweaks to make configuration file compatible with both zabbix agent 1 and 2

This commit is contained in:
Aaron Andersen 2021-03-24 19:55:00 -04:00 committed by tomberek
parent debbd84333
commit d6fd7c6613

View File

@ -128,11 +128,16 @@ in
{
LogType = "console";
Server = cfg.server;
ListenIP = cfg.listen.ip;
ListenPort = cfg.listen.port;
LoadModule = builtins.attrNames cfg.modules;
}
(mkIf (cfg.modules != {}) { LoadModulePath = "${moduleEnv}/lib"; })
(mkIf (cfg.modules != {}) {
LoadModule = builtins.attrNames cfg.modules;
LoadModulePath = "${moduleEnv}/lib";
})
# the default value for "ListenIP" is 0.0.0.0 but zabbix agent 2 cannot accept configuration files which
# explicitly set "ListenIP" to the default value...
(mkIf (cfg.listen.ip != "0.0.0.0") { ListenIP = cfg.listen.ip; })
];
networking.firewall = mkIf cfg.openFirewall {