2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchurl, autoreconfHook, makeWrapper
|
2018-12-15 03:50:31 +00:00
|
|
|
, perlPackages, 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";
|
2019-09-04 03:40:32 +01:00
|
|
|
rev = "ef3107f01afe55fad5452e64ac5bbea00b18a8d5";
|
|
|
|
sha256 = "047fwrycsl2vmpi4wl46fs6f8y191d6qc9ms5rvmrj1dm2r828ws";
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
2018-06-07 07:21:18 +01:00
|
|
|
generic = { pname, version, sha256, description, buildInputs, ... }:
|
2019-09-04 03:40:32 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
2017-08-07 15:56:15 +01:00
|
|
|
|
2018-05-15 17:23:43 +01:00
|
|
|
src = fetchurl {
|
2019-10-31 04:03:59 +00:00
|
|
|
url = "https://labs.consol.de/assets/downloads/nagios/${pname}-${version}.tar.gz";
|
2018-05-15 17:23:43 +01:00
|
|
|
inherit sha256;
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ perlPackages.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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://labs.consol.de/";
|
2017-12-05 22:20:11 +00:00
|
|
|
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";
|
2019-09-04 03:40:47 +01:00
|
|
|
version = "2.6.4.15";
|
|
|
|
sha256 = "12z0b3c2p18viy7s93r6bbl8fvgsqh80136d07118qhxshp1pwxg";
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Check plugin for Microsoft SQL Server";
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ perlPackages.DBDsybase ];
|
2018-06-07 07:21:18 +01:00
|
|
|
};
|
|
|
|
|
2017-08-07 15:56:15 +01:00
|
|
|
check-nwc-health = generic {
|
|
|
|
pname = "check_nwc_health";
|
2019-09-04 03:41:08 +01:00
|
|
|
version = "7.10.0.6";
|
|
|
|
sha256 = "092rhaqnk3403z0y60x38vgh65gcia3wrd6gp8mr7wszja38kxv2";
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Check plugin for network equipment";
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ perlPackages.NetSNMP ];
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
check-ups-health = generic {
|
|
|
|
pname = "check_ups_health";
|
2019-09-04 03:42:05 +01:00
|
|
|
version = "2.8.3.3";
|
|
|
|
sha256 = "0qc2aglppwr9ms4p53kh9nr48625sqrbn46xs0k9rx5sv8hil9hm";
|
2020-10-11 06:55:05 +01:00
|
|
|
description = "Check plugin for UPSs";
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ perlPackages.NetSNMP ];
|
2017-08-07 15:56:15 +01:00
|
|
|
};
|
|
|
|
}
|