summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/monitoring
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2017-08-07 22:56:15 +0800
committerPeter Hoeg <peter@hoeg.com>2017-08-17 15:02:38 +0800
commit39bf20e7a3d9828822fcb1c531c2abdb54dc7bd9 (patch)
tree42dbf219703c3137d6047151b4cc391dc710d415 /pkgs/servers/monitoring
parenta7c8f5e419ba07711c132bf81baaab0e74862cce (diff)
check-nwc-health and check-ups-health: init at 20170804
Diffstat (limited to 'pkgs/servers/monitoring')
-rw-r--r--pkgs/servers/monitoring/plugins/labs_consol_de.nix72
1 files changed, 72 insertions, 0 deletions
diff --git a/pkgs/servers/monitoring/plugins/labs_consol_de.nix b/pkgs/servers/monitoring/plugins/labs_consol_de.nix
new file mode 100644
index 000000000000..441d9595bbd1
--- /dev/null
+++ b/pkgs/servers/monitoring/plugins/labs_consol_de.nix
@@ -0,0 +1,72 @@
+{ stdenv, fetchFromGitHub, buildPerlPackage, autoreconfHook, makeWrapper
+, perl, NetSNMP, coreutils, gnused, gnugrep }:
+
+let
+ owner = "lausser";
+
+ glplugin = fetchFromGitHub {
+ repo = "GLPlugin";
+ rev = "b92a261ca4bf84e5b20d3025cc9a31ade03c474b";
+ sha256 = "0kflnmpjmklq8fy2vf2h8qyvaiznymdi09z2h5qscrfi51xc9gmh";
+ inherit owner;
+ };
+
+ generic = { pname, version, rev, sha256, description, ... } @ attrs:
+ let
+ attrs' = builtins.removeAttrs attrs [ "pname" "version" "rev" "sha256"];
+ in perl.stdenv.mkDerivation rec {
+ name = stdenv.lib.replaceStrings [ "-" ] [ "_" ] "${pname}-${version}";
+
+ src = fetchFromGitHub {
+ repo = pname;
+ inherit owner rev sha256;
+ };
+
+ buildInputs = [ perl NetSNMP ];
+
+ nativeBuildInputs = [ autoreconfHook makeWrapper ];
+
+ prePatch = with stdenv.lib; ''
+ ln -s ${glplugin}/* GLPlugin
+ 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; {
+ homepage = https://labs.consol.de/;
+ license = licenses.gpl2;
+ maintainer = with maintainers; [ peterhoeg ];
+ inherit description;
+ };
+ };
+
+in {
+ check-nwc-health = generic {
+ pname = "check_nwc_health";
+ version = "20170804";
+ rev = "e959b412b5cf027c82a446668e026214fdcf8df3";
+ sha256 = "11l74xw62g15rqrbf9ff2bfd5iw159gwhhgbkxwdqi8sp9j6navk";
+ description = "Check plugin for network equipment.";
+ };
+
+ check-ups-health = generic {
+ pname = "check_ups_health";
+ version = "20170804";
+ rev = "32a8a359ea46ec0d6f3b7aea19ddedaad63b04b9";
+ sha256 = "05na48dxfxrg0i9185j1ck2795p0rw1zwcs8ra0f14cm0qw0lp4l";
+ description = "Check plugin for UPSs.";
+ };
+}