diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/servers/monitoring/plugins | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/servers/monitoring/plugins')
4 files changed, 213 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/monitoring/plugins/default.nix b/nixpkgs/pkgs/servers/monitoring/plugins/default.nix new file mode 100644 index 000000000000..a0f7341571ce --- /dev/null +++ b/nixpkgs/pkgs/servers/monitoring/plugins/default.nix @@ -0,0 +1,71 @@ +{ stdenv, fetchFromGitHub, autoreconfHook +, coreutils, gnugrep, gnused, lm_sensors, net_snmp, openssh, openssl, perl }: + +with stdenv.lib; + +let + majorVersion = "2.2"; + minorVersion = ".0"; + + binPath = makeBinPath [ coreutils gnugrep gnused lm_sensors net_snmp ]; + +in stdenv.mkDerivation rec { + name = "monitoring-plugins-${majorVersion}${minorVersion}"; + + src = fetchFromGitHub { + owner = "monitoring-plugins"; + repo = "monitoring-plugins"; + rev = "v${majorVersion}"; + sha256 = "1pw7i6d2cnb5nxi2lbkwps2qzz04j9zd86fzpv9ka896b4aqrwv1"; + }; + + # !!! Awful hack. Grrr... this of course only works on NixOS. + # Anyway the check that configure performs to figure out the ping + # syntax is totally impure, because it runs an actual ping to + # localhost (which won't work for ping6 if IPv6 support isn't + # configured on the build machine). + preConfigure= '' + substituteInPlace po/Makefile.in.in \ + --replace /bin/sh ${stdenv.shell} + + sed -i configure.ac \ + -e 's|^DEFAULT_PATH=.*|DEFAULT_PATH=\"\$out/bin:/run/wrappers/bin:${binPath}\"|' + + configureFlagsArray=( + --with-ping-command='/run/wrappers/bin/ping -4 -n -U -w %d -c %d %s' + --with-ping6-command='/run/wrappers/bin/ping -6 -n -U -w %d -c %d %s' + ) + ''; + + # !!! make openssh a runtime dependency only + buildInputs = [ net_snmp openssh openssl perl ]; + + nativeBuildInputs = [ autoreconfHook ]; + + enableParallelBuilding = true; + + # For unknown reasons the installer tries executing $out/share and fails if + # it doesn't succeed. + # So we create it and remove it again later. + preBuild = '' + mkdir -p $out + cat <<_EOF > $out/share +#!${stdenv.shell} +exit 0 +_EOF + chmod 755 $out/share + ''; + + postInstall = '' + rm $out/share + ln -s libexec $out/bin + ''; + + meta = { + description = "Official monitoring plugins for Nagios/Icinga/Sensu and others."; + homepage = https://www.monitoring-plugins.org; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ thoughtpolice relrod ]; + }; +} diff --git a/nixpkgs/pkgs/servers/monitoring/plugins/esxi.nix b/nixpkgs/pkgs/servers/monitoring/plugins/esxi.nix new file mode 100644 index 000000000000..888cef61fcb6 --- /dev/null +++ b/nixpkgs/pkgs/servers/monitoring/plugins/esxi.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchFromGitHub, python2Packages }: + +let + bName = "check_esxi_hardware"; + pName = stdenv.lib.replaceStrings [ "_" ] [ "-" ] "${bName}"; + +in python2Packages.buildPythonApplication rec { + name = "${pName}-${version}"; + version = "20181001"; + + src = fetchFromGitHub { + owner = "Napsty"; + repo = bName; + rev = version; + sha256 = "0azfacxcnnxxfqzrhh29k8cnjyr88gz35bi6h8fq931fl3plv10l"; + }; + + dontBuild = true; + doCheck = false; + + installPhase = '' + runHook preInstall + + install -Dm755 -t $out/bin ${bName}.py + install -Dm644 -t $out/share/doc/${pName} README.md + + runHook postInstall + ''; + + propagatedBuildInputs = with python2Packages; [ pywbem ]; + + meta = with stdenv.lib; { + homepage = https://www.claudiokuenzler.com/nagios-plugins/; + license = licenses.gpl2; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/nixpkgs/pkgs/servers/monitoring/plugins/labs_consol_de.nix b/nixpkgs/pkgs/servers/monitoring/plugins/labs_consol_de.nix new file mode 100644 index 000000000000..5d93f4c53496 --- /dev/null +++ b/nixpkgs/pkgs/servers/monitoring/plugins/labs_consol_de.nix @@ -0,0 +1,79 @@ +{ stdenv, fetchFromGitHub, fetchurl, autoreconfHook, makeWrapper +, perl, DBDsybase, NetSNMP, coreutils, gnused, gnugrep }: + +let + glplugin = fetchFromGitHub { + owner = "lausser"; + repo = "GLPlugin"; + rev = "e8e1a2907a54435c932b3e6c584ba1d679754849"; + sha256 = "0wb55a9pmgbilfffx0wkiikg9830qd66j635ypczqp4basslpq5b"; + }; + + generic = { pname, version, sha256, description, buildInputs, ... }: + let + name' = "${stdenv.lib.replaceStrings [ "-" ] [ "_" ] "${pname}"}-${version}"; + in perl.stdenv.mkDerivation { + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://labs.consol.de/assets/downloads/nagios/${name'}.tar.gz"; + inherit sha256; + }; + + buildInputs = [ perl ] ++ buildInputs; + + nativeBuildInputs = [ autoreconfHook makeWrapper ]; + + prePatch = with stdenv.lib; '' + rm -rf GLPlugin + 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; + maintainers = with maintainers; [ peterhoeg ]; + inherit description; + }; + }; + +in { + check-mssql-health = generic { + pname = "check_mssql_health"; + version = "2.6.4.14"; + sha256 = "0w6gybrs7imx169l8740s0ax3adya867fw0abrampx59mnsj5pm1"; + description = "Check plugin for Microsoft SQL Server."; + buildInputs = [ DBDsybase ]; + }; + + check-nwc-health = generic { + pname = "check_nwc_health"; + version = "7.0.1.3"; + sha256 = "0rgd6zgd7kplx3z72n8zbzwkh8vnd83361sk9ibh6ng78sds1sl5"; + description = "Check plugin for network equipment."; + buildInputs = [ NetSNMP ]; + }; + + check-ups-health = generic { + pname = "check_ups_health"; + version = "2.8.2.2"; + sha256 = "1gc2wjsymay2vk5ywc1jj9cvrbhs0fs851x8l4nc75df2g75v521"; + description = "Check plugin for UPSs."; + buildInputs = [ NetSNMP ]; + }; +} diff --git a/nixpkgs/pkgs/servers/monitoring/plugins/uptime.nix b/nixpkgs/pkgs/servers/monitoring/plugins/uptime.nix new file mode 100644 index 000000000000..9f03c9ea96f6 --- /dev/null +++ b/nixpkgs/pkgs/servers/monitoring/plugins/uptime.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + name = "check-uptime-${version}"; + version = "20161112"; + + src = fetchFromGitHub { + owner = "madrisan"; + repo = "nagios-plugins-uptime"; + rev = "51822dacd1d404b3eabf3b4984c64b2475ed6f3b"; + sha256 = "18q9ibzqn97dsyr9xs3w9mqk80nmmfw3kcjidrdsj542amlsycyk"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + enableParallelBuilding = true; + + postInstall = "ln -sr $out/libexec $out/bin"; + + meta = with stdenv.lib; { + description = "Uptime check plugin for Sensu/Nagios/others"; + homepage = https://github.com/madrisan/nagios-plugins-uptime; + license = licenses.gpl3; + maintainers = with maintainers; [ peterhoeg ]; + }; +} |