summary refs log tree commit diff
path: root/pkgs/servers/monitoring/nagios
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2014-06-21 23:35:09 -0500
committerAustin Seipp <aseipp@pobox.com>2014-06-22 00:22:10 -0500
commit6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4 (patch)
treea066633acd2d550014bae61cf146b5aff1ddaa12 /pkgs/servers/monitoring/nagios
parentb8ede68b25af12acf88560d4bf31452390ff69b8 (diff)
downloadnixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar.gz
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar.bz2
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar.lz
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar.xz
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.tar.zst
nixlib-6cfa38ce7d5bae41e32f50c82efafa98c3ba34f4.zip
nagios: significant upgrades
 - Upgrade Nagios Core to 4.x
 - Expose mainConfigFile and cgiConfigFile in module for finer
   configuration control.
 - Upgrade Plugins to 2.x
 - Remove default objectDefs, which users probably want to customize.
 - Systemd-ify Nagios module and simplify directory structure
 - Upgrade Nagios package with more modern patch, and ensure the
   statedir is set to /var/lib/nagios

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/servers/monitoring/nagios')
-rw-r--r--pkgs/servers/monitoring/nagios/default.nix27
-rw-r--r--pkgs/servers/monitoring/nagios/nagios.patch18
-rw-r--r--pkgs/servers/monitoring/nagios/plugins/official-2.x.nix (renamed from pkgs/servers/monitoring/nagios/plugins/official/default.nix)22
3 files changed, 44 insertions, 23 deletions
diff --git a/pkgs/servers/monitoring/nagios/default.nix b/pkgs/servers/monitoring/nagios/default.nix
index dba063bb1069..5af759db1c9d 100644
--- a/pkgs/servers/monitoring/nagios/default.nix
+++ b/pkgs/servers/monitoring/nagios/default.nix
@@ -1,23 +1,30 @@
-{ stdenv, fetchurl, perl, gdSupport ? false
-, gd ? null, libpng ? null, zlib ? null
-}:
+{ stdenv, fetchurl, perl, php, gd, libpng, zlib }:
 
 stdenv.mkDerivation {
-  name = "nagios-2.10";
+  name = "nagios-4.0.7";
 
   src = fetchurl {
-    url = mirror://sourceforge/nagios/nagios-2.10.tar.gz;
-    md5 = "8c3a29e138f2ff8c8abbd3dd8a40c4b6";
+    url = mirror://sourceforge/nagios/nagios-4.x/nagios-4.0.7/nagios-4.0.7.tar.gz;
+    sha256 = "1687qnbsag84r57y9745g2klypacfixd6gkzaj42lmzn0v8y27gg";
   };
 
-  patches = [./nagios.patch];
-  buildInputs = [perl] ++ (if gdSupport then [gd libpng zlib] else []);
+  patches = [ ./nagios.patch ];
+  buildInputs = [ php perl gd libpng zlib ];
+
+  configureFlags = [ "--localstatedir=/var/lib/nagios" ];
   buildFlags = "all";
+
+  # Do not create /var directories
+  preInstall = ''
+    substituteInPlace Makefile --replace '$(MAKE) install-basic' ""
+  '';
   installTargets = "install install-config";
 
   meta = {
     description = "A host, service and network monitoring program";
-    homepage = http://www.nagios.org/;
-    license = "GPL";
+    homepage    = http://www.nagios.org/;
+    license     = stdenv.lib.licenses.gpl2;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice relrod ];
   };
 }
diff --git a/pkgs/servers/monitoring/nagios/nagios.patch b/pkgs/servers/monitoring/nagios/nagios.patch
index 6fc271536171..cec4c4942b53 100644
--- a/pkgs/servers/monitoring/nagios/nagios.patch
+++ b/pkgs/servers/monitoring/nagios/nagios.patch
@@ -1,7 +1,7 @@
-diff -ruN nagios-2.6/configure nagios-2.6.new/configure
---- nagios-2.6/configure	2006-11-28 03:29:04.000000000 +0100
-+++ nagios-2.6.new/configure	2006-12-28 01:22:56.000000000 +0100
-@@ -4810,7 +4810,8 @@
+diff -ruN nagios-4.0.7.orig/configure nagios-4.0.7/configure
+--- nagios-4.0.7.orig/configure	2014-06-03 10:41:42.000000000 -0400
++++ nagios-4.0.7/configure	2014-06-12 00:30:17.516468583 -0400
+@@ -6014,7 +6014,8 @@
  #define DEFAULT_NAGIOS_GROUP "$nagios_grp"
  _ACEOF
  
@@ -11,3 +11,13 @@ diff -ruN nagios-2.6/configure nagios-2.6.new/configure
  
  
  
+@@ -6035,7 +6036,8 @@
+ 
+ 
+ 
+-COMMAND_OPTS="-o $command_user -g $command_grp"
++#COMMAND_OPTS="-o $command_user -g $command_grp"
++COMMAND_OPTS=""
+ 
+ 
+ MAIL_PROG=no
diff --git a/pkgs/servers/monitoring/nagios/plugins/official/default.nix b/pkgs/servers/monitoring/nagios/plugins/official-2.x.nix
index c466813b23b0..3420003c641c 100644
--- a/pkgs/servers/monitoring/nagios/plugins/official/default.nix
+++ b/pkgs/servers/monitoring/nagios/plugins/official-2.x.nix
@@ -1,11 +1,12 @@
-{stdenv, fetchurl, openssh}:
+{ stdenv, fetchurl, openssh }:
 
-stdenv.mkDerivation {
-  name = "nagios-plugins-1.4.10";
+stdenv.mkDerivation rec {
+  name = "nagios-plugins-${version}";
+  version = "2.0";
 
   src = fetchurl {
-    url = https://www.monitoring-plugins.org/download/nagios-plugins-1.4.10.tar.gz;
-    sha256 = "0vm7sjiygxbfc5vbsi1g0dakpvynfzi86fhqx4yxd61brn0g8ghr";
+    url = "http://nagios-plugins.org/download/${name}.tar.gz";
+    sha256 = "113nv9jqpbqpdjqilqbj1iyshxyvcmq8w94bq5ajz4dxi9j8045s";
   };
 
   # !!! Awful hack. Grrr... this of course only works on NixOS.
@@ -22,11 +23,14 @@ stdenv.mkDerivation {
 
   postInstall = "ln -s libexec $out/bin";
 
-  buildInputs = [openssh]; # !!! make openssh a runtime dependency only
+  # !!! make openssh a runtime dependency only
+  buildInputs = [ openssh ];
 
   meta = {
-    description = "Plugins for Nagios";
-    homepage = http://www.monitoring-plugins.org;
-    license = "GPL";
+    description = "Official plugins for Nagios";
+    homepage    = http://www.nagios.org/download/plugins;
+    license     = stdenv.lib.licenses.gpl2;
+    platforms   = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ thoughtpolice relrod ];
   };
 }