about summary refs log tree commit diff
path: root/modules/services/monitoring
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-02-20 13:40:47 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-02-20 13:40:47 +0000
commit7278e370722fec09a281985c2c1392ee3ea7b007 (patch)
tree3bc863bed44e42f4f94b1c7fdd09800fe7df3136 /modules/services/monitoring
parent1770b5a400b57846996d129323000d923a6faca5 (diff)
downloadnixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar.gz
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar.bz2
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar.lz
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar.xz
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.tar.zst
nixlib-7278e370722fec09a281985c2c1392ee3ea7b007.zip
* Don't set DBHost if the database is on localhost, otherwise Zabbix
  will use TCP/IP instead of a Unix domain socket.
* Simplify Zabbix's start condition.  Zabbix now retries if the
  database is down instead of bailing out.

svn path=/nixos/trunk/; revision=32426
Diffstat (limited to 'modules/services/monitoring')
-rw-r--r--modules/services/monitoring/zabbix-server.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/services/monitoring/zabbix-server.nix b/modules/services/monitoring/zabbix-server.nix
index f59558e86dd4..046c601cb4f6 100644
--- a/modules/services/monitoring/zabbix-server.nix
+++ b/modules/services/monitoring/zabbix-server.nix
@@ -21,7 +21,9 @@ let
 
       PidFile = ${pidFile}
 
-      DBHost = ${cfg.dbServer}
+      ${optionalString (cfg.dbServer != "localhost") ''
+        DBHost = ${cfg.dbServer}
+      ''}
 
       DBName = zabbix
 
@@ -76,8 +78,7 @@ in
 
         description = "Zabbix server daemon";
 
-        startOn = if cfg.dbServer == "localhost" then "started postgresql" else "filesystem";
-        stopOn = if cfg.dbServer == "localhost" then "stopping postgresql" else "starting shutdown";
+        startOn = "filesystem";
 
         preStart =
           ''
@@ -94,6 +95,8 @@ in
             fi
           '';
 
+        path = [ pkgs.nettools ];
+
         # Zabbix doesn't have an option not to daemonize, and doesn't
         # daemonize in a way that allows Upstart to track it.  So to
         # make sure that we notice when it goes down, we start Zabbix
@@ -102,7 +105,6 @@ in
         # just monitor `cat'.
         script =
           ''
-            export PATH=${pkgs.nettools}/bin:$PATH
             rm -f ${stateDir}/dummy
             mkfifo ${stateDir}/dummy
             cat ${stateDir}/dummy &