From bd7908c6630f38067350d396ac5d18c3cc2434a0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 29 Oct 2017 11:22:34 +0000 Subject: gentoo resync : 29.10.2017 --- net-analyzer/nagios-plugins/Manifest | 2 + .../files/define-own-mysql-port-constant.patch | 100 +++++++++++++++++ .../nagios-plugins/nagios-plugins-2.2.1-r2.ebuild | 118 +++++++++++++++++++++ 3 files changed, 220 insertions(+) create mode 100644 net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch create mode 100644 net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild (limited to 'net-analyzer/nagios-plugins') diff --git a/net-analyzer/nagios-plugins/Manifest b/net-analyzer/nagios-plugins/Manifest index cdcf3a5744fe..5f467d74eee9 100644 --- a/net-analyzer/nagios-plugins/Manifest +++ b/net-analyzer/nagios-plugins/Manifest @@ -1,6 +1,8 @@ +AUX define-own-mysql-port-constant.patch 3271 SHA256 25d25d3aafa1a3e77df0ec87398a066c9db711a2559b32bdaa400ce3760b4da9 SHA512 18cb9be96b3e39a07eeb1cf6bccbbe26766ac355f4822c132253e25a6909c418071c2dc546fb60c055b78f620180035e57436a8ebb771ae1096b78d2e1c7c6ec WHIRLPOOL 0e1995aea8946108c98ad31793406b40b325768482b601530112da121d030375bee961d01e398f756d195097d4e0a196df1e3c5bc19cfece8295c7f5f1805d73 DIST nagios-plugins-2.0.3.tar.gz 2659772 SHA256 8f0021442dce0138f0285ca22960b870662e28ae8973d49d439463588aada04a SHA512 2753e6f3fc7433a5583fee01e63a65b9ea74155964f2b6e6bf3458e56cb29ea5dbd020f83816044a717b66d6548d203b3a082fba0faedcd629c7a8457bc19b36 WHIRLPOOL 4b0e4024833373df3f0db44657345a1f4495c4022e56bf6b369cc2846f9127e565520f6b7cdf1b94384592e78327d584da7d939a3ac0586e0ae67fd1258c138b DIST nagios-plugins-2.2.1.tar.gz 2728818 SHA256 647c0ba4583d891c965fc29b77c4ccfeccc21f409fdf259cb8af52cb39c21e18 SHA512 6ffe313a56a305b382f62abc0f0958d7078f9050e1340f30721d6e6f71944b57b1650e90e6835c35dd7c9f3f4b4cee9f235b8382b0811db30b3729daaafc9bc3 WHIRLPOOL 57579a7948ab1ce5c66db47e7221b5b8087e3fa027b2a69ad95129ba44af6ba13eaa4b766f3a2de11f708a80e3f44d6d54c6d513388e58c5be75c7bb166325e8 EBUILD nagios-plugins-2.0.3-r2.ebuild 2828 SHA256 8ad04b08572e3e7d56ae11f9e0b82fd87f041040fd8fbf1cfdb8a2fdd4fe6b78 SHA512 cabe19f142006c4d104721361c2c58fc7a103717041050a21bc21b47adb6702bf05c77f1ed8b063f74b11a59a2dd1120d8478e5b1d803636aeb9f1ae92c2ae91 WHIRLPOOL 3bdfcb4df0bb46509d9ce0cdfbe3e0e74cb9e7452f0f0c314f570bffac452366e858f4d0175292da9e97188c5a0ec0ffff972ca0bf821fe93ef520328c12f016 +EBUILD nagios-plugins-2.2.1-r2.ebuild 3115 SHA256 357090140031d7109f91ae8181ba24907a60a5c13eb6ee4f13d7fc2302704712 SHA512 b70231b8e2fd2dedf9e3308ac2005e43d6fef8ea2f17555cc155e689f0194e38977f9961ec233a84f81560c6dedfbdbf1d2108ce5238035a4ed101c46fbf2329 WHIRLPOOL b841614c25cd7de02a397c50581f2699b5998c4934488e040747e700e8f1b431b348785c9e69cc140e5d64c3cab774fc12d72426cbac06cb850901f9191307b4 EBUILD nagios-plugins-2.2.1.ebuild 2979 SHA256 29d987c96b656566dcc806be515cf6fd157f707f813830bd520fef7690616589 SHA512 d11747ef8007eedb29f51598bdd2109fbb17a8cc93304b441b22be94fbbbb4ce8b59132340e20999428123650972708f3812fc8134cc95256d4ab09cff6f2ba2 WHIRLPOOL 5db78b4a161216381bf3cb3d1488c37f9fd37ae7f0702d0778cdf06047763823bcd4f0710bb2bbb1a38b9b8924f8197645702161cf0d27bd95cde41dc70dc073 MISC ChangeLog 4744 SHA256 4c08d4f657682469e96dd1a18715ab6b6439de60e0b69132de016bd98acf3138 SHA512 5af2e792504b1771880084c26439b4446bf614c3e1fcc00a1b84c600eb35ce02b729af739d8f7443671a093f16d37ba5f20129c1d43aaab54640e109c128762a WHIRLPOOL 4765d0aae5d3f87f28506bcdbbfbf7e6bcf1dd5a66366b0c05c69423a910b8d4f54168f397dc84343ec85dce9d9a5170c84be02e88dbc837a4698698f0768f4c MISC ChangeLog-2015 16032 SHA256 0fcc0dcd50ab5fd579c2fe7d87c33deb815f396f4c70a31909f1da00a47b7a74 SHA512 2ac4eb36d06e72159faa28f62cafa23f8e3b5db0f030209717cf65775f1ff3bd3f95511fd5c17f95866689e77624ab76835876dc00c1598bae45d6f6e4ed9fe5 WHIRLPOOL 2eb21e54a88026a1adfbd242b1ed2892b4c28b8fb418f6dee36f2077571d9b9f25f6c82f9b3774847e62aa6e5261b695d4bdfc3d31cf06ced31aa493a6a47496 diff --git a/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch b/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch new file mode 100644 index 000000000000..67bc65cad880 --- /dev/null +++ b/net-analyzer/nagios-plugins/files/define-own-mysql-port-constant.patch @@ -0,0 +1,100 @@ +From 43ff2e8607c0b7095c2a4dcab6e466bc67e2e2ff Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky +Date: Thu, 26 Oct 2017 15:01:17 -0400 +Subject: [PATCH 1/3] plugins/check_mysql*.c: define our own default MySQL + port. + +The MYSQL_PORT constant used to be defined in mysql.h, and was used as +the default port in the two plugins check_mysql and check_mysql_query. +Now that mysql.h no longer defines that constant, our plugins fail to +build against newer versions of MySQL and MariaDB. + +Since MYSQL_PORT used the "default port" on the local system, it +actually was not the best choice as the default for the check plugins: +when monitoring remote MySQL servers, the usual default of 3306 is +more likely to be correct than whatever the local server happens to be +listening on. + +As a result, we fix the issue by defining our own constant, called +CHECK_PORT_DEFAULT, as "3306" at the top of both check_mysql.c and +check_mysql_query.c. The existing uses of MYSQL_PORT have been changed +to use the new CHECK_PORT_DEFAULT. + +This change is backwards-incompatible: any users who compiled in a +MYSQL_PORT other than 3306 and who were running their checks on the +same server as the database will now need to specify that port +explicitly. + +Closes: https://github.com/nagios-plugins/nagios-plugins/issues/288 +--- + plugins/check_mysql.c | 7 +++++-- + plugins/check_mysql_query.c | 7 +++++-- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c +index 83f89c85..c0b61292 100644 +--- a/plugins/check_mysql.c ++++ b/plugins/check_mysql.c +@@ -36,6 +36,9 @@ const char *email = "devel@nagios-plugins.org"; + + #define SLAVERESULTSIZE 70 + ++/* The default port that MySQL servers listen on. */ ++#define CHECK_PORT_DEFAULT 3306 ++ + #include "common.h" + #include "utils.h" + #include "utils_base.h" +@@ -58,7 +61,7 @@ char *ciphers = NULL; + bool ssl = false; + char *opt_file = NULL; + char *opt_group = NULL; +-unsigned int db_port = MYSQL_PORT; ++unsigned int db_port = CHECK_PORT_DEFAULT; + int check_slave = 0, warn_sec = 0, crit_sec = 0; + int ignore_auth = 0; + int verbose = 0; +@@ -505,7 +508,7 @@ void + print_help (void) + { + char *myport; +- xasprintf (&myport, "%d", MYSQL_PORT); ++ xasprintf (&myport, "%d", CHECK_PORT_DEFAULT); + + print_revision (progname, NP_VERSION); + +diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c +index 436e0685..e9c3acfb 100644 +--- a/plugins/check_mysql_query.c ++++ b/plugins/check_mysql_query.c +@@ -33,6 +33,9 @@ const char *progname = "check_mysql_query"; + const char *copyright = "1999-2014"; + const char *email = "devel@nagios-plugins.org"; + ++/* The default port that MySQL servers listen on. */ ++#define CHECK_PORT_DEFAULT 3306 ++ + #include "common.h" + #include "utils.h" + #include "utils_base.h" +@@ -48,7 +51,7 @@ char *db_pass = NULL; + char *db = NULL; + char *opt_file = NULL; + char *opt_group = NULL; +-unsigned int db_port = MYSQL_PORT; ++unsigned int db_port = CHECK_PORT_DEFAULT; + + int process_arguments (int, char **); + int validate_arguments (void); +@@ -300,7 +303,7 @@ void + print_help (void) + { + char *myport; +- xasprintf (&myport, "%d", MYSQL_PORT); ++ xasprintf (&myport, "%d", CHECK_PORT_DEFAULT); + + print_revision (progname, NP_VERSION); + +-- +2.13.6 + diff --git a/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild new file mode 100644 index 000000000000..7cdc0f879966 --- /dev/null +++ b/net-analyzer/nagios-plugins/nagios-plugins-2.2.1-r2.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit user + +DESCRIPTION="Official plugins for Nagios" +HOMEPAGE="http://nagios-plugins.org/" +SRC_URI="http://nagios-plugins.org/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="ipv6 ldap libressl mysql nagios-dns nagios-ping nagios-game postgres radius samba selinux snmp ssh +ssl" + +# Most of the plugins use automagic dependencies, i.e. the plugin will +# get built if the binary it uses is installed. For example, check_snmp +# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is +# installed. End result: most of our runtime dependencies are required +# at build time as well. +# +# REAL_DEPEND contains the dependencies that are actually needed to +# build. DEPEND contains those plus the automagic dependencies. +# +REAL_DEPEND="dev-lang/perl + ldap? ( net-nds/openldap ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:* ) + ssl? ( + !libressl? ( dev-libs/openssl:0 ) + libressl? ( dev-libs/libressl ) + ) + radius? ( net-dialup/freeradius-client )" + +DEPEND="${REAL_DEPEND} + nagios-dns? ( net-dns/bind-tools ) + nagios-game? ( games-util/qstat ) + nagios-ping? ( net-analyzer/fping ) + samba? ( net-fs/samba ) + ssh? ( net-misc/openssh ) + snmp? ( dev-perl/Net-SNMP + net-analyzer/net-snmp[-minimal] )" + +# Basically everything collides with nagios-plugins. +RDEPEND="${DEPEND} + !net-analyzer/monitoring-plugins + selinux? ( sec-policy/selinux-nagios )" + +# At least one test is interactive. +RESTRICT="test" + +DOCS=( + ACKNOWLEDGEMENTS + AUTHORS + CODING + ChangeLog + FAQ + NEWS + README + REQUIREMENTS + SUPPORT + THANKS +) + +PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" ) + +src_prepare() { + default + + # Fix the path to our perl interpreter + sed -i -e "1s:/usr/local/bin/perl:/usr/bin/perl:" \ + "${S}"/plugins-scripts/*.pl \ + || die 'failed to fix perl interpreter path' +} + +src_configure() { + # Use an array to prevent econf from mangling the ping args. + local myconf=() + + if use ssl; then + myconf+=( $(use_with ssl openssl /usr) ) + else + myconf+=( --without-openssl ) + myconf+=( --without-gnutls ) + fi + + # The autodetection for these two commands can hang if localhost is + # down or ICMP traffic is filtered. Bug #468296. + myconf+=( --with-ping-command="/bin/ping -n -U -w %d -c %d %s" ) + + if use ipv6; then + myconf+=( --with-ping6-command="/bin/ping6 -n -U -w %d -c %d %s" ) + fi + + econf \ + $(use_with mysql) \ + $(use_with ipv6) \ + $(use_with ldap) \ + $(use_with postgres pgsql /usr) \ + $(use_with radius) \ + "${myconf[@]}" \ + --libexecdir="/usr/$(get_libdir)/nagios/plugins" \ + --sysconfdir="/etc/nagios" +} + +pkg_preinst() { + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +pkg_postinst() { + elog "This ebuild has a number of USE flags that determine what you" + elog "are able to monitor. Depending on what you want to monitor, some" + elog "or all of these USE flags need to be set." + elog + elog "The plugins are installed in ${ROOT}usr/$(get_libdir)/nagios/plugins" +} -- cgit v1.2.3