2018-05-15 17:23:43 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchurl, buildPerlPackage, autoreconfHook, makeWrapper
|
2018-06-07 07:21:18 +01:00
|
|
|
, perl, DBDsybase, NetSNMP, coreutils, gnused, gnugrep }:
|
2017-08-07 15:56:15 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
glplugin = fetchFromGitHub {
|
2018-05-15 17:23:43 +01:00
|
|
|
owner = "lausser";
|
2017-08-07 15:56:15 +01:00
|
|
|
repo = "GLPlugin";
|
2018-05-15 17:23:43 +01:00
|
|
|
rev = "e8e1a2907a54435c932b3e6c584ba1d679754849";
|
|
|
|
sha256 = "0wb55a9pmgbilfffx0wkiikg9830qd66j635ypczqp4basslpq5b";
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
2018-06-07 07:21:18 +01:00
|
|
|
generic = { pname, version, sha256, description, buildInputs, ... }:
|
2017-08-07 15:56:15 +01:00
|
|
|
let
|
2018-05-15 17:23:43 +01:00
|
|
|
name' = "${stdenv.lib.replaceStrings [ "-" ] [ "_" ] "${pname}"}-${version}";
|
2018-06-07 07:21:18 +01:00
|
|
|
in perl.stdenv.mkDerivation {
|
2018-05-15 17:23:43 +01:00
|
|
|
name = "${pname}-${version}";
|
2017-08-07 15:56:15 +01:00
|
|
|
|
2018-05-15 17:23:43 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://labs.consol.de/assets/downloads/nagios/${name'}.tar.gz";
|
|
|
|
inherit sha256;
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
2018-06-07 07:21:18 +01:00
|
|
|
buildInputs = [ perl ] ++ buildInputs;
|
2017-08-07 15:56:15 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
|
|
|
|
prePatch = with stdenv.lib; ''
|
2018-05-15 17:23:43 +01:00
|
|
|
rm -rf GLPlugin
|
|
|
|
ln -s ${glplugin} GLPlugin
|
2017-08-07 15:56:15 +01:00
|
|
|
substituteInPlace plugins-scripts/Makefile.am \
|
|
|
|
--replace /bin/cat ${getBin coreutils}/bin/cat \
|
|
|
|
--replace /bin/echo ${getBin coreutils}/bin/echo \
|
|
|
|
--replace /bin/grep ${getBin gnugrep}/bin/grep \
|
|
|
|
--replace /bin/sed ${getBin gnused}/bin/sed
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
test -d $out/libexec && ln -sr $out/libexec $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for f in $out/bin/* ; do
|
|
|
|
wrapProgram $f --prefix PERL5LIB : $PERL5LIB
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-12-05 22:20:11 +00:00
|
|
|
homepage = https://labs.consol.de/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ peterhoeg ];
|
2017-08-07 15:56:15 +01:00
|
|
|
inherit description;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
2018-06-07 07:21:18 +01:00
|
|
|
check-mssql-health = generic {
|
|
|
|
pname = "check_mssql_health";
|
|
|
|
version = "2.6.4.14";
|
|
|
|
sha256 = "0w6gybrs7imx169l8740s0ax3adya867fw0abrampx59mnsj5pm1";
|
|
|
|
description = "Check plugin for Microsoft SQL Server.";
|
|
|
|
buildInputs = [ DBDsybase ];
|
|
|
|
};
|
|
|
|
|
2017-08-07 15:56:15 +01:00
|
|
|
check-nwc-health = generic {
|
|
|
|
pname = "check_nwc_health";
|
2018-05-15 17:23:43 +01:00
|
|
|
version = "7.0.1.3";
|
|
|
|
sha256 = "0rgd6zgd7kplx3z72n8zbzwkh8vnd83361sk9ibh6ng78sds1sl5";
|
2017-08-07 15:56:15 +01:00
|
|
|
description = "Check plugin for network equipment.";
|
2018-06-07 07:21:18 +01:00
|
|
|
buildInputs = [ NetSNMP ];
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
check-ups-health = generic {
|
|
|
|
pname = "check_ups_health";
|
2018-05-15 17:23:43 +01:00
|
|
|
version = "2.8.2.2";
|
|
|
|
sha256 = "1gc2wjsymay2vk5ywc1jj9cvrbhs0fs851x8l4nc75df2g75v521";
|
2017-08-07 15:56:15 +01:00
|
|
|
description = "Check plugin for UPSs.";
|
2018-06-07 07:21:18 +01:00
|
|
|
buildInputs = [ NetSNMP ];
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
}
|