tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
check-nwc-health and check-ups-health: init at 20170804
Peter Hoeg
8 years ago
39bf20e7
a7c8f5e4
+75
2 changed files
expand all
collapse all
unified
split
pkgs
servers
monitoring
plugins
labs_consol_de.nix
top-level
all-packages.nix
+72
pkgs/servers/monitoring/plugins/labs_consol_de.nix
···
1
1
+
{ stdenv, fetchFromGitHub, buildPerlPackage, autoreconfHook, makeWrapper
2
2
+
, perl, NetSNMP, coreutils, gnused, gnugrep }:
3
3
+
4
4
+
let
5
5
+
owner = "lausser";
6
6
+
7
7
+
glplugin = fetchFromGitHub {
8
8
+
repo = "GLPlugin";
9
9
+
rev = "b92a261ca4bf84e5b20d3025cc9a31ade03c474b";
10
10
+
sha256 = "0kflnmpjmklq8fy2vf2h8qyvaiznymdi09z2h5qscrfi51xc9gmh";
11
11
+
inherit owner;
12
12
+
};
13
13
+
14
14
+
generic = { pname, version, rev, sha256, description, ... } @ attrs:
15
15
+
let
16
16
+
attrs' = builtins.removeAttrs attrs [ "pname" "version" "rev" "sha256"];
17
17
+
in perl.stdenv.mkDerivation rec {
18
18
+
name = stdenv.lib.replaceStrings [ "-" ] [ "_" ] "${pname}-${version}";
19
19
+
20
20
+
src = fetchFromGitHub {
21
21
+
repo = pname;
22
22
+
inherit owner rev sha256;
23
23
+
};
24
24
+
25
25
+
buildInputs = [ perl NetSNMP ];
26
26
+
27
27
+
nativeBuildInputs = [ autoreconfHook makeWrapper ];
28
28
+
29
29
+
prePatch = with stdenv.lib; ''
30
30
+
ln -s ${glplugin}/* GLPlugin
31
31
+
substituteInPlace plugins-scripts/Makefile.am \
32
32
+
--replace /bin/cat ${getBin coreutils}/bin/cat \
33
33
+
--replace /bin/echo ${getBin coreutils}/bin/echo \
34
34
+
--replace /bin/grep ${getBin gnugrep}/bin/grep \
35
35
+
--replace /bin/sed ${getBin gnused}/bin/sed
36
36
+
'';
37
37
+
38
38
+
postInstall = ''
39
39
+
test -d $out/libexec && ln -sr $out/libexec $out/bin
40
40
+
'';
41
41
+
42
42
+
postFixup = ''
43
43
+
for f in $out/bin/* ; do
44
44
+
wrapProgram $f --prefix PERL5LIB : $PERL5LIB
45
45
+
done
46
46
+
'';
47
47
+
48
48
+
meta = with stdenv.lib; {
49
49
+
homepage = https://labs.consol.de/;
50
50
+
license = licenses.gpl2;
51
51
+
maintainer = with maintainers; [ peterhoeg ];
52
52
+
inherit description;
53
53
+
};
54
54
+
};
55
55
+
56
56
+
in {
57
57
+
check-nwc-health = generic {
58
58
+
pname = "check_nwc_health";
59
59
+
version = "20170804";
60
60
+
rev = "e959b412b5cf027c82a446668e026214fdcf8df3";
61
61
+
sha256 = "11l74xw62g15rqrbf9ff2bfd5iw159gwhhgbkxwdqi8sp9j6navk";
62
62
+
description = "Check plugin for network equipment.";
63
63
+
};
64
64
+
65
65
+
check-ups-health = generic {
66
66
+
pname = "check_ups_health";
67
67
+
version = "20170804";
68
68
+
rev = "32a8a359ea46ec0d6f3b7aea19ddedaad63b04b9";
69
69
+
sha256 = "05na48dxfxrg0i9185j1ck2795p0rw1zwcs8ra0f14cm0qw0lp4l";
70
70
+
description = "Check plugin for UPSs.";
71
71
+
};
72
72
+
}
+3
pkgs/top-level/all-packages.nix
···
11340
11340
munin = callPackage ../servers/monitoring/munin { };
11341
11341
11342
11342
nagiosPluginsOfficial = callPackage ../servers/monitoring/nagios/plugins/official-2.x.nix { };
11343
11343
+
inherit (callPackage ../servers/monitoring/plugins/labs_consol_de.nix { inherit (perlPackages) NetSNMP; })
11344
11344
+
check-nwc-health
11345
11345
+
check-ups-health;
11343
11346
11344
11347
neo4j = callPackage ../servers/nosql/neo4j { };
11345
11348