From 1c451d351fe48ba0a3e0b844b5311c153089e9e0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 26 Nov 2010 22:50:57 +0000 Subject: [PATCH] * Make the location of the database configurable. svn path=/nixos/trunk/; revision=24888 --- modules/services/monitoring/zabbix-server.nix | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/services/monitoring/zabbix-server.nix b/modules/services/monitoring/zabbix-server.nix index 65b1a3cafa9..0dc3aaf75f5 100644 --- a/modules/services/monitoring/zabbix-server.nix +++ b/modules/services/monitoring/zabbix-server.nix @@ -5,6 +5,8 @@ with pkgs.lib; let + cfg = config.services.zabbixServer; + stateDir = "/var/run/zabbix"; logDir = "/var/log/zabbix"; @@ -19,9 +21,15 @@ let PidFile = ${pidFile} + DBHost = ${cfg.dbServer} + DBName = zabbix DBUser = zabbix + + ${optionalString (cfg.dbPassword != "") '' + DBPassword = ${cfg.dbPassword} + ''} ''; in @@ -39,11 +47,21 @@ in ''; }; + services.zabbixServer.dbServer = mkOption { + default = "localhost"; + description = "Hostname or IP address of the database server."; + }; + + services.zabbixServer.dbPassword = mkOption { + default = ""; + description = "Password used to connect to the database server."; + }; + }; ###### implementation - config = mkIf config.services.zabbixServer.enable { + config = mkIf cfg.enable { services.postgresql.enable = true;