2018-05-15 16:23:43 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchurl, buildPerlPackage, autoreconfHook, makeWrapper
|
2017-08-07 14:56:15 +00:00
|
|
|
, perl, NetSNMP, coreutils, gnused, gnugrep }:
|
|
|
|
|
|
|
|
let
|
|
|
|
glplugin = fetchFromGitHub {
|
2018-05-15 16:23:43 +00:00
|
|
|
owner = "lausser";
|
2017-08-07 14:56:15 +00:00
|
|
|
repo = "GLPlugin";
|
2018-05-15 16:23:43 +00:00
|
|
|
rev = "e8e1a2907a54435c932b3e6c584ba1d679754849";
|
|
|
|
sha256 = "0wb55a9pmgbilfffx0wkiikg9830qd66j635ypczqp4basslpq5b";
|
2017-08-07 14:56:15 +00:00
|
|
|
};
|
|
|
|
|
2018-05-15 16:23:43 +00:00
|
|
|
generic = { pname, version, sha256, description, ... } @ attrs:
|
2017-08-07 14:56:15 +00:00
|
|
|
let
|
|
|
|
attrs' = builtins.removeAttrs attrs [ "pname" "version" "rev" "sha256"];
|
2018-05-15 16:23:43 +00:00
|
|
|
name' = "${stdenv.lib.replaceStrings [ "-" ] [ "_" ] "${pname}"}-${version}";
|
2017-08-07 14:56:15 +00:00
|
|
|
in perl.stdenv.mkDerivation rec {
|
2018-05-15 16:23:43 +00:00
|
|
|
name = "${pname}-${version}";
|
2017-08-07 14:56:15 +00:00
|
|
|
|
2018-05-15 16:23:43 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://labs.consol.de/assets/downloads/nagios/${name'}.tar.gz";
|
|
|
|
inherit sha256;
|
2017-08-07 14:56:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl NetSNMP ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
|
|
|
|
|
|
|
prePatch = with stdenv.lib; ''
|
2018-05-15 16:23:43 +00:00
|
|
|
rm -rf GLPlugin
|
|
|
|
ln -s ${glplugin} GLPlugin
|
2017-08-07 14:56:15 +00: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 14:56:15 +00:00
|
|
|
inherit description;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
check-nwc-health = generic {
|
|
|
|
pname = "check_nwc_health";
|
2018-05-15 16:23:43 +00:00
|
|
|
version = "7.0.1.3";
|
|
|
|
sha256 = "0rgd6zgd7kplx3z72n8zbzwkh8vnd83361sk9ibh6ng78sds1sl5";
|
2017-08-07 14:56:15 +00:00
|
|
|
description = "Check plugin for network equipment.";
|
|
|
|
};
|
|
|
|
|
|
|
|
check-ups-health = generic {
|
|
|
|
pname = "check_ups_health";
|
2018-05-15 16:23:43 +00:00
|
|
|
version = "2.8.2.2";
|
|
|
|
sha256 = "1gc2wjsymay2vk5ywc1jj9cvrbhs0fs851x8l4nc75df2g75v521";
|
2017-08-07 14:56:15 +00:00
|
|
|
description = "Check plugin for UPSs.";
|
|
|
|
};
|
|
|
|
}
|