uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
120
pkgs/servers/monitoring/plugins/default.nix
Normal file
120
pkgs/servers/monitoring/plugins/default.nix
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, writeShellScript
|
||||
, autoreconfHook
|
||||
, pkg-config
|
||||
, runCommand
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, gnused
|
||||
, lm_sensors
|
||||
, net-snmp
|
||||
, openssh
|
||||
, openssl
|
||||
, perl
|
||||
, dnsutils
|
||||
, libdbi
|
||||
, libmysqlclient
|
||||
, uriparser
|
||||
, zlib
|
||||
, openldap
|
||||
, procps
|
||||
, runtimeShell
|
||||
}:
|
||||
|
||||
let
|
||||
binPath = lib.makeBinPath [
|
||||
(placeholder "out")
|
||||
"/run/wrappers"
|
||||
coreutils
|
||||
gnugrep
|
||||
gnused
|
||||
lm_sensors
|
||||
net-snmp
|
||||
procps
|
||||
];
|
||||
|
||||
mailq = runCommand "mailq-wrapper" { preferLocalBuild = true; } ''
|
||||
mkdir -p $out/bin
|
||||
ln -s /run/wrappers/bin/sendmail $out/bin/mailq
|
||||
'';
|
||||
|
||||
# For unknown reasons the installer tries executing $out/share and fails so
|
||||
# we create it and remove it again later.
|
||||
share = writeShellScript "share" ''
|
||||
exit 0
|
||||
'';
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "monitoring-plugins";
|
||||
version = "2.3.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "monitoring-plugins";
|
||||
repo = "monitoring-plugins";
|
||||
rev = "v" + lib.versions.majorMinor version;
|
||||
sha256 = "sha256-yLhHOSrPFRjW701aOL8LPe4OnuJxL6f+dTxNqm0evIg=";
|
||||
};
|
||||
|
||||
# TODO: 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).
|
||||
#
|
||||
# --with-ping-command needs to be done here instead of in
|
||||
# configureFlags due to the spaces in the argument
|
||||
postPatch = ''
|
||||
substituteInPlace po/Makefile.in.in \
|
||||
--replace /bin/sh ${runtimeShell}
|
||||
|
||||
sed -i configure.ac \
|
||||
-e 's|^DEFAULT_PATH=.*|DEFAULT_PATH=\"${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'
|
||||
)
|
||||
|
||||
install -Dm555 ${share} $out/share
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--libexecdir=${placeholder "out"}/bin"
|
||||
"--with-mailq-command=${mailq}/bin/mailq"
|
||||
"--with-sudo-command=/run/wrappers/bin/sudo"
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dnsutils
|
||||
libdbi
|
||||
libmysqlclient
|
||||
net-snmp
|
||||
openldap
|
||||
# TODO: make openssh a runtime dependency only
|
||||
openssh
|
||||
openssl
|
||||
perl
|
||||
procps
|
||||
uriparser
|
||||
zlib
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
postInstall = ''
|
||||
rm $out/share
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Official monitoring plugins for Nagios/Icinga/Sensu and others";
|
||||
homepage = "https://www.monitoring-plugins.org";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ thoughtpolice relrod ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
36
pkgs/servers/monitoring/plugins/esxi.nix
Normal file
36
pkgs/servers/monitoring/plugins/esxi.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{ lib, fetchFromGitHub, python3Packages }:
|
||||
|
||||
let
|
||||
bName = "check_esxi_hardware";
|
||||
|
||||
in python3Packages.buildPythonApplication rec {
|
||||
pname = lib.replaceStrings [ "_" ] [ "-" ] bName;
|
||||
version = "20200710";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Napsty";
|
||||
repo = bName;
|
||||
rev = version;
|
||||
sha256 = "EC6np/01S+5SA2H9z5psJ9Pq/YoEyGdHL9wHUKKsNas=";
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
doCheck = false;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 ${bName}.py $out/bin/${bName}
|
||||
install -Dm644 -t $out/share/doc/${pname} README.md
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ pywbem requests setuptools ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.claudiokuenzler.com/nagios-plugins/";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
77
pkgs/servers/monitoring/plugins/labs_consol_de.nix
Normal file
77
pkgs/servers/monitoring/plugins/labs_consol_de.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchurl, autoreconfHook, makeWrapper
|
||||
, perlPackages, coreutils, gnused, gnugrep }:
|
||||
|
||||
let
|
||||
glplugin = fetchFromGitHub {
|
||||
owner = "lausser";
|
||||
repo = "GLPlugin";
|
||||
rev = "ef3107f01afe55fad5452e64ac5bbea00b18a8d5";
|
||||
sha256 = "047fwrycsl2vmpi4wl46fs6f8y191d6qc9ms5rvmrj1dm2r828ws";
|
||||
};
|
||||
|
||||
generic = { pname, version, sha256, description, buildInputs, ... }:
|
||||
stdenv.mkDerivation {
|
||||
inherit pname version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://labs.consol.de/assets/downloads/nagios/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
buildInputs = [ perlPackages.perl ] ++ buildInputs;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook makeWrapper ];
|
||||
|
||||
prePatch = with 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 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.15";
|
||||
sha256 = "12z0b3c2p18viy7s93r6bbl8fvgsqh80136d07118qhxshp1pwxg";
|
||||
description = "Check plugin for Microsoft SQL Server";
|
||||
buildInputs = [ perlPackages.DBDsybase ];
|
||||
};
|
||||
|
||||
check-nwc-health = generic {
|
||||
pname = "check_nwc_health";
|
||||
version = "7.10.0.6";
|
||||
sha256 = "092rhaqnk3403z0y60x38vgh65gcia3wrd6gp8mr7wszja38kxv2";
|
||||
description = "Check plugin for network equipment";
|
||||
buildInputs = [ perlPackages.NetSNMP ];
|
||||
};
|
||||
|
||||
check-ups-health = generic {
|
||||
pname = "check_ups_health";
|
||||
version = "2.8.3.3";
|
||||
sha256 = "0qc2aglppwr9ms4p53kh9nr48625sqrbn46xs0k9rx5sv8hil9hm";
|
||||
description = "Check plugin for UPSs";
|
||||
buildInputs = [ perlPackages.NetSNMP ];
|
||||
};
|
||||
}
|
||||
22
pkgs/servers/monitoring/plugins/openvpn.nix
Normal file
22
pkgs/servers/monitoring/plugins/openvpn.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ lib, fetchFromGitHub, python3Packages }:
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "check-openvpn";
|
||||
version = "0.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "liquidat";
|
||||
repo = "nagios-icinga-openvpn";
|
||||
rev = version;
|
||||
sha256 = "1vz3p7nckc5k5f06nm1xfzpykhyndh2dzyagmifrzg5k478p1lpm";
|
||||
};
|
||||
|
||||
# no tests
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A nagios/icinga/sensu check plugin for OpenVPN";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
26
pkgs/servers/monitoring/plugins/uptime.nix
Normal file
26
pkgs/servers/monitoring/plugins/uptime.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "check-uptime";
|
||||
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 lib; {
|
||||
description = "Uptime check plugin for Sensu/Nagios/others";
|
||||
homepage = "https://github.com/madrisan/nagios-plugins-uptime";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
46
pkgs/servers/monitoring/plugins/wmic-bin.nix
Normal file
46
pkgs/servers/monitoring/plugins/wmic-bin.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ stdenv, lib, fetchFromGitHub, autoPatchelfHook, popt }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "wmic-bin";
|
||||
version = "0.5.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "R-Vision";
|
||||
repo = "wmi-client";
|
||||
rev = version;
|
||||
sha256 = "1w1mdbiwz37wzry1q38h8dyjaa6iggmsb9wcyhhlawwm1vj50w48";
|
||||
};
|
||||
|
||||
buildInputs = [ popt ];
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 bin/wmic_ubuntu_x64 $out/bin/wmic
|
||||
install -Dm644 -t $out/share/doc/wmic LICENSE README.md
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
$out/bin/wmic --help >/dev/null
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "WMI client for Linux (binary)";
|
||||
homepage = "https://www.openvas.org";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
};
|
||||
}
|
||||
77
pkgs/servers/monitoring/plugins/wmiplus/default.nix
Normal file
77
pkgs/servers/monitoring/plugins/wmiplus/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, stdenv, fetchFromGitHub, makeWrapper, perlPackages, txt2man
|
||||
, monitoring-plugins
|
||||
, wmic-bin ? null }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "check-wmiplus";
|
||||
version = "1.65";
|
||||
|
||||
# We fetch from github.com instead of the proper upstream as nix-build errors
|
||||
# out with 406 when trying to fetch the sources
|
||||
src = fetchFromGitHub {
|
||||
owner = "speartail";
|
||||
repo = "checkwmiplus";
|
||||
rev = "v${version}";
|
||||
sha256 = "1as0iyhy4flpm37mb7lvah7rnd6ax88appjm1icwhy7iq03wi8pl";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./wmiplus_fix_manpage.patch
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with perlPackages; [
|
||||
BHooksEndOfScope ClassDataInheritable ClassInspector ClassSingleton
|
||||
ConfigIniFiles DateTime DateTimeLocale DateTimeTimeZone DevelStackTrace
|
||||
EvalClosure ExceptionClass FileShareDir ModuleImplementation ModuleRuntime
|
||||
MROCompat namespaceautoclean namespaceclean NumberFormat PackageStash
|
||||
ParamsValidate ParamsValidationCompiler RoleTiny Specio
|
||||
SubExporterProgressive SubIdentify TryTiny
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper txt2man ];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
doCheck = false; # no checks
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace check_wmi_plus.pl \
|
||||
--replace /usr/bin/wmic ${wmic-bin}/bin/wmic \
|
||||
--replace /etc/check_wmi_plus $out/etc/check_wmi_plus \
|
||||
--replace /opt/nagios/bin/plugins $out/etc/check_wmi_plus \
|
||||
--replace /usr/lib/nagios/plugins ${monitoring-plugins}/libexec \
|
||||
--replace '$base_dir/check_wmi_plus_help.pl' "$out/bin/check_wmi_plus_help.pl"
|
||||
|
||||
for f in *.pl ; do
|
||||
substituteInPlace $f --replace /usr/bin/perl ${perlPackages.perl}/bin/perl
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -Dm755 -t $out/bin *.pl
|
||||
install -Dm644 -t $out/share/doc/${pname} *.txt
|
||||
cp -r etc $out/
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# 1. we need to wait until the main binary has been fixed up with proper perl paths before we can run it to generate the man page
|
||||
# 2. txt2man returns exit code 3 even if it works, so we add the || true bit
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/check_wmi_plus.pl \
|
||||
--set PERL5LIB "${perlPackages.makePerlPath propagatedBuildInputs}"
|
||||
|
||||
mkdir -p $out/share/man/man1
|
||||
$out/bin/check_wmi_plus.pl --help | txt2man -d 1970-01-01 -s 1 -t check_wmi_plus -r "Check WMI Plus ${version}" > $out/share/man/man1/check_wmi_plus.1 || true
|
||||
gzip $out/share/man/man1/check_wmi_plus.1
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A sensu/nagios plugin using WMI to query Windows hosts";
|
||||
homepage = "http://edcint.co.nz/checkwmiplus";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
diff --git a/check_wmi_plus.makeman.sh b/check_wmi_plus.makeman.sh
|
||||
index 38dc7a4..3fe4369 100755
|
||||
--- a/check_wmi_plus.makeman.sh
|
||||
+++ b/check_wmi_plus.makeman.sh
|
||||
@@ -19,15 +19,6 @@ mkdir -p "$manpage_dir/man1"
|
||||
# the full path to the manpage file
|
||||
manfile="$manpage_dir/man1/check_wmi_plus.1"
|
||||
|
||||
-# if we are not running in a terminal then only show the text-based help
|
||||
-if [ ! -t 0 ]; then
|
||||
- # we are not running in a terminal
|
||||
- echo "Not running in a terminal - showing text-based help"
|
||||
- echo
|
||||
- exec $check_wmi_plus_text_help
|
||||
-fi
|
||||
-
|
||||
-
|
||||
usage()
|
||||
{
|
||||
cat << EOT
|
||||
diff --git a/check_wmi_plus_help.pl b/check_wmi_plus_help.pl
|
||||
index 3440db2..2982da2 100755
|
||||
--- a/check_wmi_plus_help.pl
|
||||
+++ b/check_wmi_plus_help.pl
|
||||
@@ -24,7 +24,7 @@ if ($opt_help) {
|
||||
# we have the script to make the manpage and have not been asked to show text only help
|
||||
exec ("$make_manpage_script \"$0 --itexthelp\" \"$manpage_dir\"") or print STDERR "couldn't exec $make_manpage_script: $!";
|
||||
} else {
|
||||
- print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n";
|
||||
+ # print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,4 +692,4 @@ show_ini_help_overview(1);
|
||||
finish_program($ERRORS{'UNKNOWN'});
|
||||
}
|
||||
|
||||
-1;
|
||||
\ No newline at end of file
|
||||
+1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue