Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/monitoring-plugins/
Date: Sun, 03 Mar 2019 00:53:54
Message-Id: 1551574260.31cbd149b087f323dd75bd0c4db9fefae47a084b.sbraz@gentoo
1 commit: 31cbd149b087f323dd75bd0c4db9fefae47a084b
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 27 11:21:43 2019 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 00:51:00 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31cbd149
7
8 net-analyzer/monitoring-plugins: make 'check_ping -4' call 'ping -4'
9
10 Currently, when calling 'check_ping -4' on a host that has both A and AAAA
11 records, the AAAA record is used. This is because the IPv4 ping command
12 is set to 'ping' at configure-time, when it should be 'ping -4'.
13
14 For consistency, this commit also changes the IPv6 ping command from
15 'ping6' to 'ping -6'.
16
17 The upstream issue is
18 https://github.com/monitoring-plugins/monitoring-plugins/issues/898.
19 Changing the ping command at configure-time was proposed in
20 https://github.com/monitoring-plugins/monitoring-plugins/pull/1531.
21
22 Package-Manager: Portage-2.3.62, Repoman-2.3.12
23 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
24 Closes: https://github.com/gentoo/gentoo/pull/11169
25
26 .../monitoring-plugins-2.2-r4.ebuild | 104 +++++++++++++++++++++
27 1 file changed, 104 insertions(+)
28
29 diff --git a/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r4.ebuild b/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r4.ebuild
30 new file mode 100644
31 index 00000000000..ae1073c7cae
32 --- /dev/null
33 +++ b/net-analyzer/monitoring-plugins/monitoring-plugins-2.2-r4.ebuild
34 @@ -0,0 +1,104 @@
35 +# Copyright 1999-2019 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit eutils flag-o-matic multilib user
41 +
42 +DESCRIPTION="50+ standard plugins for Icinga, Naemon, Nagios, Shinken, Sensu"
43 +HOMEPAGE="https://www.monitoring-plugins.org/"
44 +SRC_URI="https://www.monitoring-plugins.org/download/${P}.tar.gz"
45 +
46 +LICENSE="GPL-3"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~arm ~arm64 ~sparc ~x86"
49 +IUSE="gnutls ipv6 ldap libressl mysql dns fping game postgres radius samba snmp ssh +ssl"
50 +
51 +# Most of the plugins use automagic dependencies, i.e. the plugin will
52 +# get built if the binary it uses is installed. For example, check_snmp
53 +# will be built only if snmpget from net-analyzer/net-snmp[-minimal] is
54 +# installed. End result: most of our runtime dependencies are required
55 +# at build time as well.
56 +#
57 +# REAL_DEPEND contains the dependencies that are actually needed to
58 +# build. DEPEND contains those plus the automagic dependencies.
59 +#
60 +REAL_DEPEND="dev-lang/perl
61 + ldap? ( net-nds/openldap )
62 + mysql? ( dev-db/mysql-connector-c:= )
63 + postgres? ( dev-db/postgresql:= )
64 + ssl? (
65 + !gnutls? (
66 + !libressl? ( dev-libs/openssl:0= )
67 + libressl? ( dev-libs/libressl:= )
68 + )
69 + gnutls? ( net-libs/gnutls )
70 + )
71 + radius? ( net-dialup/freeradius-client )"
72 +
73 +DEPEND="${REAL_DEPEND}
74 + dns? ( net-dns/bind-tools )
75 + game? ( games-util/qstat )
76 + fping? ( net-analyzer/fping )
77 + samba? ( net-fs/samba )
78 + ssh? ( net-misc/openssh )
79 + snmp? ( dev-perl/Net-SNMP
80 + net-analyzer/net-snmp[-minimal] )"
81 +
82 +# Basically everything collides with nagios-plugins.
83 +RDEPEND="${DEPEND}
84 + !net-analyzer/nagios-plugins"
85 +
86 +# At least one test is interactive.
87 +RESTRICT="test"
88 +
89 +PATCHES=( "${FILESDIR}/define-own-mysql-port-constant.patch" )
90 +
91 +src_configure() {
92 + append-flags -fno-strict-aliasing
93 +
94 + # Use an array to prevent econf from mangling the ping args.
95 + local myconf=()
96 +
97 + if use ssl; then
98 + myconf+=( $(use_with !gnutls openssl /usr)
99 + $(use_with gnutls gnutls /usr) )
100 + else
101 + myconf+=( --without-openssl )
102 + myconf+=( --without-gnutls )
103 + fi
104 +
105 + # The autodetection for these two commands can hang if localhost is
106 + # down or ICMP traffic is filtered. Bug #468296.
107 + myconf+=( --with-ping-command="/bin/ping -4 -n -U -w %d -c %d %s" )
108 +
109 + if use ipv6; then
110 + myconf+=( --with-ping6-command="/bin/ping -6 -n -U -w %d -c %d %s" )
111 + fi
112 +
113 + econf \
114 + $(use_with mysql) \
115 + $(use_with ipv6) \
116 + $(use_with ldap) \
117 + $(use_with postgres pgsql /usr) \
118 + $(use_with radius) \
119 + "${myconf[@]}" \
120 + --libexecdir="/usr/$(get_libdir)/nagios/plugins" \
121 + --sysconfdir="/etc/nagios"
122 +}
123 +
124 +DOCS=( ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ \
125 + NEWS README REQUIREMENTS SUPPORT THANKS )
126 +
127 +pkg_preinst() {
128 + enewgroup nagios
129 + enewuser nagios -1 /bin/bash /var/nagios/home nagios
130 +}
131 +
132 +pkg_postinst() {
133 + elog "This ebuild has a number of USE flags that determine what you"
134 + elog "are able to monitor. Depending on what you want to monitor, some"
135 + elog "or all of these USE flags need to be set."
136 + elog
137 + elog "The plugins are installed in ${EROOT%/}/usr/$(get_libdir)/nagios/plugins"
138 +}