diff --git a/system/options.nix b/system/options.nix index d216c58f994..862a8224fbf 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2045,6 +2045,7 @@ zabbixAgent = { + enable = mkOption { default = false; description = " @@ -2052,6 +2053,14 @@ It will send monitoring data to a Zabbix server. "; }; + + server = mkOption { + default = "127.0.0.1"; + description = '' + The IP address or hostname of the Zabbix server to connect to. + ''; + }; + }; diff --git a/upstart-jobs/zabbix-agent.nix b/upstart-jobs/zabbix-agent.nix index 78d21d3f96d..3fde1a62f62 100644 --- a/upstart-jobs/zabbix-agent.nix +++ b/upstart-jobs/zabbix-agent.nix @@ -2,6 +2,8 @@ let + cfg = config.services.zabbixAgent; + stateDir = "/var/run/zabbix"; logDir = "/var/log/zabbix"; @@ -9,7 +11,7 @@ let pidFile = "${stateDir}/zabbix_agentd.pid"; configFile = pkgs.writeText "zabbix_agentd.conf" '' - Server = 127.0.0.1 + Server = ${cfg.server} LogFile = ${logDir}/zabbix_agentd