From 6d380a8ce8c5241e09cdf8cb887bd60cb8b54c07 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 8 Jun 2008 22:21:56 +0000 Subject: [PATCH] * Option to set the Zabbix server IP. svn path=/nixos/trunk/; revision=12012 --- system/options.nix | 9 +++++++++ upstart-jobs/zabbix-agent.nix | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) 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