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>
This commit is contained in:
Austin Seipp
2014-06-21 23:35:09 -05:00
parent b8ede68b25
commit 6cfa38ce7d
10 changed files with 106 additions and 193 deletions

View File

@@ -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 ];
};
}

View File

@@ -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

View File

@@ -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 ];
};
}

View File

@@ -6756,13 +6756,11 @@ let
mysql_jdbc = callPackage ../servers/sql/mysql/jdbc { };
nagios = callPackage ../servers/monitoring/nagios {
gdSupport = true;
};
nagios = callPackage ../servers/monitoring/nagios { };
munin = callPackage ../servers/monitoring/munin { };
nagiosPluginsOfficial = callPackage ../servers/monitoring/nagios/plugins/official { };
nagiosPluginsOfficial = callPackage ../servers/monitoring/nagios/plugins/official-2.x.nix { };
net_snmp = callPackage ../servers/monitoring/net-snmp { };