nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 autoreconfHook,
3 coreutils,
4 fetchFromGitHub,
5 gnugrep,
6 gnused,
7 lib,
8 makeWrapper,
9 perlPackages,
10 stdenv,
11}:
12
13let
14 generic =
15 {
16 pname,
17 version,
18 src,
19 description,
20 buildInputs,
21 }:
22 stdenv.mkDerivation {
23 inherit pname version src;
24
25 buildInputs = [ perlPackages.perl ] ++ buildInputs;
26
27 nativeBuildInputs = [
28 autoreconfHook
29 makeWrapper
30 ];
31
32 postPatch = ''
33 substituteInPlace plugins-scripts/Makefile.am \
34 --replace-fail /bin/cat ${lib.getExe' coreutils "cat"} \
35 --replace-fail /bin/echo ${lib.getExe' coreutils "echo"} \
36 --replace-fail /bin/grep ${lib.getExe gnugrep} \
37 --replace-fail /bin/sed ${lib.getExe gnused}
38 '';
39
40 postInstall = ''
41 if [[ -d $out/libexec ]]; then
42 ln -sr $out/libexec $out/bin
43 fi
44 '';
45
46 postFixup = ''
47 for f in $out/bin/* ; do
48 wrapProgram $f --prefix PERL5LIB : $PERL5LIB
49 done
50 '';
51
52 meta = {
53 homepage = "https://labs.consol.de/";
54 license = lib.licenses.gpl2Only;
55 maintainers = with lib.maintainers; [ peterhoeg ];
56 inherit description;
57 };
58 };
59
60in
61{
62 check_mssql_health = generic rec {
63 pname = "check-mssql-health";
64 version = "2.7.7";
65
66 src = fetchFromGitHub {
67 owner = "lausser";
68 repo = "check_mssql_health";
69 tag = version;
70 hash = "sha256-K6sGrms9z59a9rkZNulwKBexGF2Nkqqak/cRg12ynxc=";
71 fetchSubmodules = true;
72 };
73
74 description = "Check plugin for Microsoft SQL Server";
75 buildInputs = [ perlPackages.DBDsybase ];
76 };
77
78 check_nwc_health = generic rec {
79 pname = "check-nwc-health";
80 version = "11.7";
81
82 src = fetchFromGitHub {
83 owner = "lausser";
84 repo = "check_nwc_health";
85 tag = version;
86 hash = "sha256-r8Cb9RnEohNp0GxMAIaj7e08dTWZhuV1jz4/b8tuJ6k=";
87 fetchSubmodules = true;
88 };
89
90 description = "Check plugin for network equipment";
91 buildInputs = [ perlPackages.NetSNMP ];
92 };
93
94 check_ups_health = generic rec {
95 pname = "check-ups-health";
96 version = "4.3.1.1";
97
98 src = fetchFromGitHub {
99 owner = "lausser";
100 repo = "check_ups_health";
101 tag = version;
102 hash = "sha256-ZGSTPVJObP49/tDASOCh4wVdMKajheHD+xVTiFf101k=";
103 fetchSubmodules = true;
104 };
105
106 description = "Check plugin for UPSs";
107 buildInputs = [ perlPackages.NetSNMP ];
108 };
109}