From 3d013ccac70a281416dccbb6757f76818222cbba Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 6 Nov 2022 15:20:09 +0000 Subject: gentoo auto-resync : 06:11:2022 - 15:20:09 --- net-analyzer/Manifest.gz | Bin 44560 -> 44549 bytes net-analyzer/monitoring-plugins/Manifest | 2 + .../monitoring-plugins-2.3.2.ebuild | 104 ++++++++ net-analyzer/nagios-core/Manifest | 3 +- .../nagios-core/nagios-core-4.4.7-r1.ebuild | 268 --------------------- net-analyzer/nagios-core/nagios-core-4.4.8.ebuild | 266 ++++++++++++++++++++ net-analyzer/nagios/Manifest | 1 + net-analyzer/nagios/nagios-4.4.8.ebuild | 15 ++ net-analyzer/pnp4nagios/Manifest | 4 + .../files/pnp4nagios-0.6.26_p20221106_compat.patch | 53 ++++ .../files/pnp4nagios-0.6.26_p20221106_php80.patch | 42 ++++ .../pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild | 114 +++++++++ 12 files changed, 603 insertions(+), 269 deletions(-) create mode 100644 net-analyzer/monitoring-plugins/monitoring-plugins-2.3.2.ebuild delete mode 100644 net-analyzer/nagios-core/nagios-core-4.4.7-r1.ebuild create mode 100644 net-analyzer/nagios-core/nagios-core-4.4.8.ebuild create mode 100644 net-analyzer/nagios/nagios-4.4.8.ebuild create mode 100644 net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_compat.patch create mode 100644 net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_php80.patch create mode 100644 net-analyzer/pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild (limited to 'net-analyzer') diff --git a/net-analyzer/Manifest.gz b/net-analyzer/Manifest.gz index 83a07f1d89ca..a58067eebbae 100644 Binary files a/net-analyzer/Manifest.gz and b/net-analyzer/Manifest.gz differ diff --git a/net-analyzer/monitoring-plugins/Manifest b/net-analyzer/monitoring-plugins/Manifest index 1357e5cb697b..17cc6818b8cd 100644 --- a/net-analyzer/monitoring-plugins/Manifest +++ b/net-analyzer/monitoring-plugins/Manifest @@ -1,6 +1,8 @@ AUX define-own-mysql-port-constant.patch 3296 BLAKE2B 7a7c88c6f2c71bc1fc2f802ad202c2d2dbf3ede5af55dbe46cc15a064d37178b27670e30aa7bea07147456ce4d3e1ce9f495fa6df9deb4095367a7427e217719 SHA512 3ead6340800ac15fbe76e223599a5b3dbc6b6b13b72b684919aa43487838564ad7117b4e67fa7f36f0f58554fd8b8d6233efbcb82e6927a0c31f22c6a9ab5dbb AUX monitoring-plugins-fix-check-disk-on-btrfs.patch 913 BLAKE2B 7fb50e4b83a64da3ebfbe94eafcb03ffc39b6ec1440112c7c1e98c9dfb020466dddecee074cf61fbcdacecae58982456bab99d6e1d771148bb6f111ec9db0900 SHA512 8e4ab9eb474413b22a6893bbcab01edd655bf354c263cfba339c37b2c14093ab22aac05d732576266fa3e98880b29473cf5ff29494c54e954215f58a5768409e DIST monitoring-plugins-2.3.1.tar.gz 2529669 BLAKE2B 8dbbab78c1e57e249024fe57439acb41960585f2cccba20d03ca75a04b87e84752665f49cfe545c6a409d29094077dac0485aef872586f853e2f0f2187bf5070 SHA512 0ae76bc776997ed23d142ad9a688edc4df9b8ec0f9539b446e4fb4849a165cc88e97cbfb3a7a9a450de452e021d38f2e4ada7e8a22d78cf58e17e266472d01d7 +DIST monitoring-plugins-2.3.2.tar.gz 2766966 BLAKE2B 1a9c35e8df22d5666005b4b79f5a7ee878c0d4be1e98039f341b198a658747010e8c9d1c0a1818d67a402e5c302ec5eb5073628d52c29caf41dbc2ce57c18f6c SHA512 d155f09ddd99f4e0d065627d3bf8768e13ae3f58ed25912f33b070cd24d6f3f43243616ec3e2d496dec633feee6b1f14950035a928034a1413f725814e850765 EBUILD monitoring-plugins-2.3.1-r2.ebuild 3036 BLAKE2B 7428b5713ceb286428f3b680393c9d1a223cf7e5d096433040a2efe0c8e0cc4cd50041f6fe70bcd8c9c2df02497a6a1b70da0a7b1310dc53efd11ec67389ac42 SHA512 cf86c9664d7dc43923441176aa3cf1e960137c94c9b83374c0fa32d04aa9f1460face47f3f4621a544e5a0cfe285fc412e86fdd6d39c004b4bb3afd798687953 EBUILD monitoring-plugins-2.3.1-r3.ebuild 3046 BLAKE2B b3ae12e1527c6e02491dcdaeff811b727cc9ac083dca737e8acf03cacad56450402627e2407e1f616a410fd32f88c5545ba3d81e4819ede55e42e5361ad4a7fd SHA512 27938ca4a072e93c33de7544f840baeb45042c5d7ecd650c7eea5452ab4da4ec13f710bb55acb194ef93340a62a6a2307cff69c679bd473c08b3f3586e35c4e1 +EBUILD monitoring-plugins-2.3.2.ebuild 2977 BLAKE2B d075be742695b4e37361c8268f33742162a90c0e227a6c15681e8eb49a087362555bca64fd76bf5d2ca1956995b85b3ffac6e8a033dc3b0e8bc8f8050b40f370 SHA512 1110e2a98caa018f6ea0ca75e767e42c6ffa4582d672b7a6bd566450c92d4139a9b546745b960bff5a1ff27b010a715e6e67dbd5590e84d2d8e5768a71970966 MISC metadata.xml 1435 BLAKE2B 19cf3223867cee4899e5bdaf33948497c5cd66e94198b6a0c081ea440bf7ecfc7dcf4855b44a7ead5fc983756490f3a79059d51202be9d9f2eea24c6857eb165 SHA512 c781d735ced89fe81d49f400ada6916702ad2825c35c6bb589199902917df415a50335ce058eea45e6eb3fe66813ed2f4009cc6831e15d2b7369fcc12e8c0b26 diff --git a/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.2.ebuild b/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.2.ebuild new file mode 100644 index 000000000000..68ba0969bbbc --- /dev/null +++ b/net-analyzer/monitoring-plugins/monitoring-plugins-2.3.2.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" + +inherit flag-o-matic + +DESCRIPTION="50+ standard plugins for Icinga, Naemon, Nagios, Shinken, Sensu" +HOMEPAGE="https://www.monitoring-plugins.org/" +SRC_URI="https://www.monitoring-plugins.org/download/${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~sparc ~x86" +IUSE="curl gnutls ipv6 ldap mysql dns fping game postgres radius samba 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 + curl? ( + dev-libs/uriparser + net-misc/curl + ) + ldap? ( net-nds/openldap:= ) + mysql? ( || ( dev-db/mysql-connector-c dev-db/mariadb-connector-c ) ) + postgres? ( dev-db/postgresql:= ) + ssl? ( + !gnutls? ( + dev-libs/openssl:0= + ) + gnutls? ( net-libs/gnutls ) + ) + radius? ( net-dialup/freeradius-client )" + +DEPEND="${REAL_DEPEND} + dns? ( net-dns/bind-tools ) + game? ( games-util/qstat ) + fping? ( 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} + acct-group/nagios + acct-user/nagios + !net-analyzer/nagios-plugins" + +# At least one test is interactive. +RESTRICT="test" + +src_configure() { + append-flags -fno-strict-aliasing + + # Use an array to prevent econf from mangling the ping args. + local myconf=() + + if use ssl; then + myconf+=( $(use_with !gnutls openssl /usr) + $(use_with gnutls gnutls /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 -4 -n -U -w %d -c %d %s" ) + + if use ipv6; then + myconf+=( --with-ping6-command="/bin/ping -6 -n -U -w %d -c %d %s" ) + fi + + econf \ + $(use_with curl libcurl) \ + $(use_with curl uriparser) \ + $(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" +} + +DOCS=( ACKNOWLEDGEMENTS AUTHORS CODING ChangeLog FAQ \ + NEWS README REQUIREMENTS SUPPORT THANKS ) + +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 ${EROOT}/usr/$(get_libdir)/nagios/plugins" +} diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest index 4572f0123fb0..d2ddc1d7047f 100644 --- a/net-analyzer/nagios-core/Manifest +++ b/net-analyzer/nagios-core/Manifest @@ -2,7 +2,8 @@ AUX 99_nagios4-r1.conf 309 BLAKE2B c539330d9f100045fc02d13061dd3b8e958370c8885ef AUX lighttpd_nagios4-r1.conf 297 BLAKE2B 8976123407c47be6023c5dae57c833f7e0b43ae2c70348dcd72b754453b5a84dd335daa222b4b75e5c19b3d5c18b64496739bdb61b8f2f67f5655b80a0ffb65f SHA512 2ef5268e9ba228d12e3dabb5a23ce73e49b7149a047acd4a2daac3cd3415b5233aaaf3b972c85780e71bd5fe3eefb6755a6222b40a509104fb318e219366867f AUX nagios-core-4.4.7-upgrade-sslfix.patch 3818 BLAKE2B b6c8eff521ed909100a1469b01524e049082d5e4a7fef55b1743256cf67717985d2a2e80ff813b72eaf3014c7671225d40b646448915796766307846838e7692 SHA512 25df0d64ed03cdb122208a42daf0f1ddf5730f0a1a803f1821bfef431f7780486874a5e1a0bd6ef7361420dddde6b8bfc13210e18c48084c73ae74600d54a2de DIST nagios-4.4.7.tar.gz 11340759 BLAKE2B 4316e6cfc7f576d0fe5ba075aba2931dc850c97fe84b124eceeefaa6c01563c0639c8cecf751e086d5a6f9c0a1079f7e9bd013f961956d7d59536dea4516cf86 SHA512 92adc74e687bcbbd742075c8c7222d42c90795a4eb7582e3f1f492349db8200c61f390bf3c4cab4b023c5c111353a43f5dd687b0ee5ab6a8775444e06d42517b +DIST nagios-4.4.8.tar.gz 11339420 BLAKE2B 785705824a5a47d5f20ac0f3d756d51d6362e230514e486e1dc1fa10488a9f7ca724cc96635f2965aac1bb9dc76dee3cf2ab4e2c1be77b239540b87d1a139a21 SHA512 56448628e54b9467d14978b039fc7b37f48be624757a1bd9fe16810101f3ce4a5d740e1c9c367d2b3a8bc408a56bdf295955d8b73d5d74ee92f4750b908e88a7 DIST nagios-core-gentoo-icons-20141125.tar 40960 BLAKE2B 31c1953e1160c7c7b89606b72b1a80407e4c1b7a7938b40bd1c577cd0c309dd88ca6b775d692a9b846dbf67736537fa9c91e56aa15fdd447769608ca525bff09 SHA512 bf109879cddd6136b76baba55d0b60b2596e37431dcf5ce0905d34a9fa292ebf7e4bde82d9a084362c486e8fac344c76d88f9298b1b85541ed70ffd608493766 -EBUILD nagios-core-4.4.7-r1.ebuild 9300 BLAKE2B 9cb92e9ca16a0ab828bbca70074a2e19a9c493bda848e52f01459e1faf704380a1cbacc6be04cce1fb654e77318c9c3943d7453e50dd0fa3b941a2c05619d46a SHA512 22ca0681b3997a01641b542525e20edbed0bcb6938f0c7473d220d000fa30b0995d089c5d19b789a5a54fe1ee5f54d1578381f660bb825e5e091530ee7ba6120 EBUILD nagios-core-4.4.7.ebuild 9243 BLAKE2B cdbc7b6b1f4ee156db7000d4413f33722d888c7cdb2bca0f072d189219cc677d9da6a255590b126505f9ac27329ff2361d55e5eebc47c2e553bf2200a370e36c SHA512 81b8c9af2f2b0dd9dcb362163c2bc224de97fe0327ee97b4376ddab373a1c657fe3be88bb948e0d9f6398aab6a9f79bca40e757adbc0130d473530c0f5570bed +EBUILD nagios-core-4.4.8.ebuild 9247 BLAKE2B 40d7dad2eee11a9c30cb346ef1212fe745b07ca433e74604356d3950c6656983786fc45ee738780b9c7e5768116a74c3404b60cbd5e7751284bc2f36fc0d08c8 SHA512 cc821f4c300994fdbf759d9c10e4afa14e71075de45886117533cff8fe1c493d77e69eb0027fd1e0e6369e2e9d12c2a08e1c03aad365710df469815f3716d8dd MISC metadata.xml 1467 BLAKE2B d5ddd6280aafd3ad3a36a408071037fa757810382761f617eb2763a20e65185b30eef94fb4cdad7d4b5e9b81b6245efacf57d4ec0003406d66ef2053f09f3708 SHA512 25d3d4d19c18b416a0902d2ff39c0ca71b2e7bcc2bac61119b9636c6462391e65b2767d8b0e794abb318b19fe1c2bcbf2c80ee8d1ea6faec3f6eb9cddf60a9cd diff --git a/net-analyzer/nagios-core/nagios-core-4.4.7-r1.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.7-r1.ebuild deleted file mode 100644 index 86ae61814588..000000000000 --- a/net-analyzer/nagios-core/nagios-core-4.4.7-r1.ebuild +++ /dev/null @@ -1,268 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit systemd toolchain-funcs - -MY_P="${PN/-core}-${PV}" -DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation" -HOMEPAGE="https://www.nagios.org/" - -# The name of the directory into which our Gentoo icons will be -# extracted, and also the basename of the archive containing it. -GENTOO_ICONS="${PN}-gentoo-icons-20141125" -SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz - web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="apache2 classicui lighttpd +web vim-syntax" - -# In pkg_postinst(), we change the group of the Nagios configuration -# directory to that of the web server user. It can't belong to both -# apache/lighttpd groups at the same time, so we block this combination -# for our own sanity. -# -# This could be made to work, but we would need a better way to allow -# the web user read-only access to Nagios's configuration directory. -# -REQUIRED_USE="apache2? ( !lighttpd )" - -# -# Note, we require one of the apache2 CGI modules: -# -# * mod_cgi (USE=apache2_modules_cgi) -# * mod_cgid (USE=apache2_modules_cgid) -# * mod_fcgid (www-apache/mod_fcgid) -# -# We just don't care /which/ one. And of course PHP supports both CGI -# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the -# dependencies, and expect the user not to do anything /too/ -# stupid. (For example, installing Apache with only FastCGI support, and -# PHP with only CGI support.) -# -# Another annoyance is that the upstream Makefile uses app-arch/unzip to -# extract a snapshot of AngularJS, but that's only needed when USE=web. -# -MOD_ALIAS=apache2_modules_alias - -# The dependencies checked by the configure script. All of these are -# also runtime dependencies; that's why ./configure checks for them. -CONFIGURE_DEPEND="acct-group/nagios - acct-user/nagios - virtual/mailx - dev-lang/perl:=" - -# In addition to the things that the ./configure script checks for, -# we also need to be able to unzip stuff on the build host. -# -# We need the apache/lighttpd groups in src_install() for the things -# installed as the --with-command-group argument, so they go here too. -# The groups are also needed at runtime, but that is ensured by apache -# and lighttpd themselves being in RDEPEND. -BDEPEND="${CONFIGURE_DEPEND} - apache2? ( acct-group/apache ) - lighttpd? ( acct-group/lighttpd ) - web? ( app-arch/unzip )" - -# This is linked into /usr/bin/nagios{,tats} -DEPEND="dev-libs/libltdl:0" - -RDEPEND="${CONFIGURE_DEPEND} - ${DEPEND} - web? ( - media-libs/gd[jpeg,png] - lighttpd? ( www-servers/lighttpd[php] ) - apache2? ( - || ( - www-servers/apache[${MOD_ALIAS},apache2_modules_cgi] - www-servers/apache[${MOD_ALIAS},apache2_modules_cgid] - ( www-servers/apache[${MOD_ALIAS}] www-apache/mod_fcgid ) ) - || ( - dev-lang/php:*[apache2] - dev-lang/php:*[cgi] - dev-lang/php:*[fpm] ) - ) - ) - vim-syntax? ( app-vim/nagios-syntax )" - -S="${WORKDIR}/${MY_P}" - -PATCHES=( "${FILESDIR}/${P}-upgrade-sslfix.patch" ) - -src_configure() { - local myconf - - if use !apache2 && use !lighttpd ; then - myconf="${myconf} --with-command-group=nagios" - else - if use apache2 ; then - myconf="${myconf} --with-command-group=apache" - myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" - elif use lighttpd ; then - myconf="${myconf} --with-command-group=lighttpd" - fi - fi - - # We pass "unknown" as the init type because we don't want it to - # guess. Later on, we'll manually install both OpenRC and systemd - # services. - econf ${myconf} \ - --prefix="${EPREFIX}/usr" \ - --bindir="${EPREFIX}/usr/sbin" \ - --localstatedir="${EPREFIX}/var/lib/nagios" \ - --sysconfdir="${EPREFIX}/etc/nagios" \ - --libexecdir="${EPREFIX}/usr/$(get_libdir)/nagios/plugins" \ - --with-cgibindir="${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin" \ - --with-webdir="${EPREFIX}/usr/share/nagios/htdocs" \ - --with-init-type="unknown" - - # The paths in the web server configuration files need to match - # those passed to econf above. - cp "${FILESDIR}/99_nagios4-r1.conf" \ - "${FILESDIR}/lighttpd_nagios4-r1.conf" \ - "${T}/" || die "failed to create copies of web server conf files" - - sed -e "s|@CGIBINDIR@|${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin|g" \ - -e "s|@WEBDIR@|${EPREFIX}/usr/share/nagios/htdocs|" \ - -i "${T}/99_nagios4-r1.conf" \ - -i "${T}/lighttpd_nagios4-r1.conf" \ - || die "failed to substitute paths into web server conf files" - -} - -src_compile() { - emake CC="$(tc-getCC)" nagios - - if use web; then - # Only compile the CGIs/HTML when USE=web is set. - emake CC="$(tc-getCC)" cgis html - fi -} - -src_install() { - dodoc Changelog CONTRIBUTING.md README.md THANKS UPGRADING - - # There is no way to install the CGIs unstripped from the top-level - # makefile, so descend into base/ here. The empty INSTALL_OPTS - # ensures that root:root: owns the nagios executables. - cd "${S}/base" || die - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped - cd "${S}" || die - - # Otherwise this gets installed as 770 and you get "access denied" - # for some reason or other when starting nagios. The permissions - # on nagiostats are just for consistency (these should both get - # fixed upstream). - fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats - - # INSTALL_OPTS are needed for most of install-basic, but we don't - # want them on the LIBEXECDIR, argh. - emake DESTDIR="${D}" install-basic - fowners root:root /usr/$(get_libdir)/nagios/plugins - - # Don't make the configuration owned by the nagios user, because - # then he can edit nagios.cfg and trick nagios into running as root - # and doing his bidding. - emake INSTALL_OPTS="" DESTDIR="${D}" install-config - - # No INSTALL_OPTS used in install-commandmode, thankfully. - emake DESTDIR="${D}" install-commandmode - - # The build system installs these directories, but portage assumes - # that the build system doesn't know what it's doing so we have to - # keepdir them, too. I guess you'll have to manually re-check the - # upstream build system forever to see if this is still necessary. - keepdir /var/lib/nagios{,/archives,/rw,/spool,/spool/checkresults} - - if use web; then - # There is no way to install the CGIs unstripped from the - # top-level makefile, so descend into cgi/ here. The empty - # INSTALL_OPTS ensures that root:root: owns the CGI executables. - cd "${S}/cgi" || die - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped - cd "${S}" || die - - # install-html installs the new exfoliation theme - emake INSTALL_OPTS="" DESTDIR="${D}" install-html - - if use classicui; then - # This overwrites the already-installed exfoliation theme - emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui - fi - - # Install cute Gentoo icons (bug #388323), setting their - # owner, group, and mode to match those of the rest of Nagios's - # images. - insinto /usr/share/nagios/htdocs/images/logos - doins "${WORKDIR}/${GENTOO_ICONS}"/*.* - fi - - # The ./configure script for nagios detects the init system on the - # build host, which is wrong for all sorts of reasons. We've gone - # to great lengths above to avoid running "install-init" -- even - # indirectly -- and so now we must install whatever service files - # we need by hand. - newinitd startup/openrc-init nagios - systemd_newunit startup/default-service nagios.service - - if use web ; then - if use apache2 ; then - # Install the Nagios configuration file for Apache. - insinto "/etc/apache2/modules.d" - newins "${T}/99_nagios4-r1.conf" "99_nagios4.conf" - elif use lighttpd ; then - # Install the Nagios configuration file for Lighttpd. - insinto /etc/lighttpd - newins "${T}/lighttpd_nagios4-r1.conf" nagios.conf - else - ewarn "${CATEGORY}/${PF} only supports apache or lighttpd" - ewarn "out of the box. Since you are not using one of them, you" - ewarn "will have to configure your webserver yourself." - fi - fi -} - -pkg_postinst() { - - if use web; then - if use apache2 || use lighttpd ; then - if use apache2; then - elog "To enable the Nagios web front-end, please edit" - elog "${ROOT}/etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\"" - elog "to APACHE2_OPTS. Then Nagios will be available at," - elog - elif use lighttpd; then - elog "To enable the Nagios web front-end, please add" - elog "'include \"nagios.conf\"' to the lighttpd configuration" - elog "file at ${ROOT}/etc/lighttpd/lighttpd.conf. Then Nagios" - elog "will be available at," - elog - fi - - elog " http://localhost/nagios/" - fi - fi - - elog - elog "If your kernel has /proc protection, nagios" - elog "will not be happy as it relies on accessing the proc" - elog "filesystem. You can fix this by adding nagios into" - elog "the group wheel, but this is not recomended." - elog - - if [ -n "${REPLACING_VERSIONS}" ]; then - ewarn "The local state directory for nagios has changed in v4.4.5," - ewarn "from ${EROOT}/var/nagios to ${EROOT}/var/lib/nagios. If you" - ewarn "wish to migrate your state to the new location, first stop" - ewarn "nagios and then run" - ewarn "" - ewarn " diff --recursive --brief ${EROOT}/var/nagios ${EROOT}/var/lib/nagios" - ewarn "" - ewarn "to identify any files that should be moved to the new" - ewarn "location. They can simply be moved with \"mv\" before" - ewarn "restarting nagios." - fi -} diff --git a/net-analyzer/nagios-core/nagios-core-4.4.8.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.8.ebuild new file mode 100644 index 000000000000..e0583cea138b --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-4.4.8.ebuild @@ -0,0 +1,266 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd toolchain-funcs + +MY_P="${PN/-core}-${PV}" +DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation" +HOMEPAGE="https://www.nagios.org/" + +# The name of the directory into which our Gentoo icons will be +# extracted, and also the basename of the archive containing it. +GENTOO_ICONS="${PN}-gentoo-icons-20141125" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz + web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="apache2 classicui lighttpd +web vim-syntax" + +# In pkg_postinst(), we change the group of the Nagios configuration +# directory to that of the web server user. It can't belong to both +# apache/lighttpd groups at the same time, so we block this combination +# for our own sanity. +# +# This could be made to work, but we would need a better way to allow +# the web user read-only access to Nagios's configuration directory. +# +REQUIRED_USE="apache2? ( !lighttpd )" + +# +# Note, we require one of the apache2 CGI modules: +# +# * mod_cgi (USE=apache2_modules_cgi) +# * mod_cgid (USE=apache2_modules_cgid) +# * mod_fcgid (www-apache/mod_fcgid) +# +# We just don't care /which/ one. And of course PHP supports both CGI +# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the +# dependencies, and expect the user not to do anything /too/ +# stupid. (For example, installing Apache with only FastCGI support, and +# PHP with only CGI support.) +# +# Another annoyance is that the upstream Makefile uses app-arch/unzip to +# extract a snapshot of AngularJS, but that's only needed when USE=web. +# +MOD_ALIAS=apache2_modules_alias + +# The dependencies checked by the configure script. All of these are +# also runtime dependencies; that's why ./configure checks for them. +CONFIGURE_DEPEND="acct-group/nagios + acct-user/nagios + virtual/mailx + dev-lang/perl:=" + +# In addition to the things that the ./configure script checks for, +# we also need to be able to unzip stuff on the build host. +# +# We need the apache/lighttpd groups in src_install() for the things +# installed as the --with-command-group argument, so they go here too. +# The groups are also needed at runtime, but that is ensured by apache +# and lighttpd themselves being in RDEPEND. +BDEPEND="${CONFIGURE_DEPEND} + apache2? ( acct-group/apache ) + lighttpd? ( acct-group/lighttpd ) + web? ( app-arch/unzip )" + +# This is linked into /usr/bin/nagios{,tats} +DEPEND="dev-libs/libltdl:0" + +RDEPEND="${CONFIGURE_DEPEND} + ${DEPEND} + web? ( + media-libs/gd[jpeg,png] + lighttpd? ( www-servers/lighttpd[php] ) + apache2? ( + || ( + www-servers/apache[${MOD_ALIAS},apache2_modules_cgi] + www-servers/apache[${MOD_ALIAS},apache2_modules_cgid] + ( www-servers/apache[${MOD_ALIAS}] www-apache/mod_fcgid ) ) + || ( + dev-lang/php:*[apache2] + dev-lang/php:*[cgi] + dev-lang/php:*[fpm] ) + ) + ) + vim-syntax? ( app-vim/nagios-syntax )" + +S="${WORKDIR}/${MY_P}" + +src_configure() { + local myconf + + if use !apache2 && use !lighttpd ; then + myconf="${myconf} --with-command-group=nagios" + else + if use apache2 ; then + myconf="${myconf} --with-command-group=apache" + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d" + elif use lighttpd ; then + myconf="${myconf} --with-command-group=lighttpd" + fi + fi + + # We pass "unknown" as the init type because we don't want it to + # guess. Later on, we'll manually install both OpenRC and systemd + # services. + econf ${myconf} \ + --prefix="${EPREFIX}/usr" \ + --bindir="${EPREFIX}/usr/sbin" \ + --localstatedir="${EPREFIX}/var/lib/nagios" \ + --sysconfdir="${EPREFIX}/etc/nagios" \ + --libexecdir="${EPREFIX}/usr/$(get_libdir)/nagios/plugins" \ + --with-cgibindir="${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin" \ + --with-webdir="${EPREFIX}/usr/share/nagios/htdocs" \ + --with-init-type="unknown" + + # The paths in the web server configuration files need to match + # those passed to econf above. + cp "${FILESDIR}/99_nagios4-r1.conf" \ + "${FILESDIR}/lighttpd_nagios4-r1.conf" \ + "${T}/" || die "failed to create copies of web server conf files" + + sed -e "s|@CGIBINDIR@|${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin|g" \ + -e "s|@WEBDIR@|${EPREFIX}/usr/share/nagios/htdocs|" \ + -i "${T}/99_nagios4-r1.conf" \ + -i "${T}/lighttpd_nagios4-r1.conf" \ + || die "failed to substitute paths into web server conf files" + +} + +src_compile() { + emake CC="$(tc-getCC)" nagios + + if use web; then + # Only compile the CGIs/HTML when USE=web is set. + emake CC="$(tc-getCC)" cgis html + fi +} + +src_install() { + dodoc Changelog CONTRIBUTING.md README.md THANKS UPGRADING + + # There is no way to install the CGIs unstripped from the top-level + # makefile, so descend into base/ here. The empty INSTALL_OPTS + # ensures that root:root: owns the nagios executables. + cd "${S}/base" || die + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped + cd "${S}" || die + + # Otherwise this gets installed as 770 and you get "access denied" + # for some reason or other when starting nagios. The permissions + # on nagiostats are just for consistency (these should both get + # fixed upstream). + fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats + + # INSTALL_OPTS are needed for most of install-basic, but we don't + # want them on the LIBEXECDIR, argh. + emake DESTDIR="${D}" install-basic + fowners root:root /usr/$(get_libdir)/nagios/plugins + + # Don't make the configuration owned by the nagios user, because + # then he can edit nagios.cfg and trick nagios into running as root + # and doing his bidding. + emake INSTALL_OPTS="" DESTDIR="${D}" install-config + + # No INSTALL_OPTS used in install-commandmode, thankfully. + emake DESTDIR="${D}" install-commandmode + + # The build system installs these directories, but portage assumes + # that the build system doesn't know what it's doing so we have to + # keepdir them, too. I guess you'll have to manually re-check the + # upstream build system forever to see if this is still necessary. + keepdir /var/lib/nagios{,/archives,/rw,/spool,/spool/checkresults} + + if use web; then + # There is no way to install the CGIs unstripped from the + # top-level makefile, so descend into cgi/ here. The empty + # INSTALL_OPTS ensures that root:root: owns the CGI executables. + cd "${S}/cgi" || die + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped + cd "${S}" || die + + # install-html installs the new exfoliation theme + emake INSTALL_OPTS="" DESTDIR="${D}" install-html + + if use classicui; then + # This overwrites the already-installed exfoliation theme + emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui + fi + + # Install cute Gentoo icons (bug #388323), setting their + # owner, group, and mode to match those of the rest of Nagios's + # images. + insinto /usr/share/nagios/htdocs/images/logos + doins "${WORKDIR}/${GENTOO_ICONS}"/*.* + fi + + # The ./configure script for nagios detects the init system on the + # build host, which is wrong for all sorts of reasons. We've gone + # to great lengths above to avoid running "install-init" -- even + # indirectly -- and so now we must install whatever service files + # we need by hand. + newinitd startup/openrc-init nagios + systemd_newunit startup/default-service nagios.service + + if use web ; then + if use apache2 ; then + # Install the Nagios configuration file for Apache. + insinto "/etc/apache2/modules.d" + newins "${T}/99_nagios4-r1.conf" "99_nagios4.conf" + elif use lighttpd ; then + # Install the Nagios configuration file for Lighttpd. + insinto /etc/lighttpd + newins "${T}/lighttpd_nagios4-r1.conf" nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports apache or lighttpd" + ewarn "out of the box. Since you are not using one of them, you" + ewarn "will have to configure your webserver yourself." + fi + fi +} + +pkg_postinst() { + + if use web; then + if use apache2 || use lighttpd ; then + if use apache2; then + elog "To enable the Nagios web front-end, please edit" + elog "${ROOT}/etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\"" + elog "to APACHE2_OPTS. Then Nagios will be available at," + elog + elif use lighttpd; then + elog "To enable the Nagios web front-end, please add" + elog "'include \"nagios.conf\"' to the lighttpd configuration" + elog "file at ${ROOT}/etc/lighttpd/lighttpd.conf. Then Nagios" + elog "will be available at," + elog + fi + + elog " http://localhost/nagios/" + fi + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog + + if [ -n "${REPLACING_VERSIONS}" ]; then + ewarn "The local state directory for nagios has changed in v4.4.5," + ewarn "from ${EROOT}/var/nagios to ${EROOT}/var/lib/nagios. If you" + ewarn "wish to migrate your state to the new location, first stop" + ewarn "nagios and then run" + ewarn "" + ewarn " diff --recursive --brief ${EROOT}/var/nagios ${EROOT}/var/lib/nagios" + ewarn "" + ewarn "to identify any files that should be moved to the new" + ewarn "location. They can simply be moved with \"mv\" before" + ewarn "restarting nagios." + fi +} diff --git a/net-analyzer/nagios/Manifest b/net-analyzer/nagios/Manifest index 92f0479bad43..8170b1bb8e76 100644 --- a/net-analyzer/nagios/Manifest +++ b/net-analyzer/nagios/Manifest @@ -1,2 +1,3 @@ EBUILD nagios-4.4.7.ebuild 393 BLAKE2B a1fd423a0911c48daf7ec881bfa33300d79ccd6a1f1d2d69fd6123914d418f59a245cafa3d3b9f3a5a66953eec4e0745ca446657b5aab9092e9c36c118839cca SHA512 1639ff8068154b4aaed81f02b3d1667e843196f9a41664bfef39bf465feeab44c68fe95bfe38dcf1e128af6ed534038bd30a2c84ee0d81fabb75f38e666f8a35 +EBUILD nagios-4.4.8.ebuild 397 BLAKE2B 13d10c72a4d061e26542c1032373af9d83862a685e9112a28b320856bb929e742faaf89a17971b13c13d57025438422ba45b2aa170d9ab1bd35b70b7bb0963b6 SHA512 8fbaf5c5f6f1d1bb8a785865ac6096a365fcf21229e160c8e6e756554eb8f465bc68cbbd7ef5c68aac2bc74e590340b872a337567a02a6acfe88059174ec6d0e MISC metadata.xml 1111 BLAKE2B d2c8f269fe7ef92c656219c0c93efca6083c09ea1ea402ccab7cf37f415931ad5abdf46a20b568ec82883a574005a4788617c0786c20c2d326b2d481195261e0 SHA512 e6c32f8405e79a4a3cf03d21dce3539c28454d75929348efb30f5c7c2b55f5346e3cd39f9d64f4e276aaad12f1fbf274f2fc08c255c03df1a5a7f0356031d66e diff --git a/net-analyzer/nagios/nagios-4.4.8.ebuild b/net-analyzer/nagios/nagios-4.4.8.ebuild new file mode 100644 index 000000000000..25c696692b74 --- /dev/null +++ b/net-analyzer/nagios/nagios-4.4.8.ebuild @@ -0,0 +1,15 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="The Nagios metapackage" +HOMEPAGE="https://www.nagios.org/" + +LICENSE="metapackage" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="" + +RDEPEND="~net-analyzer/nagios-core-${PV} + || ( net-analyzer/nagios-plugins net-analyzer/monitoring-plugins )" diff --git a/net-analyzer/pnp4nagios/Manifest b/net-analyzer/pnp4nagios/Manifest index 3eda8b0888ce..917b54a0a427 100644 --- a/net-analyzer/pnp4nagios/Manifest +++ b/net-analyzer/pnp4nagios/Manifest @@ -3,6 +3,10 @@ AUX npcd.initd 364 BLAKE2B b985e4951f95807f4d1d887cfe4f65780150ec827cbe6995e24a9 AUX pnp4nagios-0.6.14-makefile.patch 1057 BLAKE2B 623115771d66839df357cf19ceb0eac9600cac220cb77b77638c76ac1a5a419b7dd83145192779cfeb845a122729728bccd7cc069de1a4da51180aabbff1b91c SHA512 a67e4b66b0f24db25f9b67d982d99a90c20ad229d404537c9963b2e9f1c5df39a46faa34ecdeb1a9e69b46efd96104d97a39a7e326a01d1c2d09dcc149171602 AUX pnp4nagios-0.6.26-magic-quotes.patch 987 BLAKE2B 02bc9b3f3c8d3289593147530d8f7f41927e301e9af854c0c57840ea769b3db2fef1222ede7c125f22e1d0ea7e1c62e14bedc387b6e9f185d0bafcf6b1f2532b SHA512 80fdb4013740dabfc31cf990f4c1a517c0002b94aec7f48d408230045ca696147763fedb04cff5da4954962305fe026bf4bcbc575f04cb16e7d96f49536b0715 AUX pnp4nagios-0.6.26-sizeof.patch 15528 BLAKE2B f6db44720ef2a68dc5d617427fd9d0813ce34e5fe922bd25153df482420a5b2d718ccd90a09a6073e803345a48e6545e39430522d45b6fea4f4924617ff4583e SHA512 02e671a31371662a1e0958dd704b7918360d20bd2fc4171d2d8c7d0332bc37356b24929834ae910858072812f7fa6d61ba4097ff1f93848e0d02b55aee515290 +AUX pnp4nagios-0.6.26_p20221106_compat.patch 2331 BLAKE2B 87cb67ef587cb7b0a67a6112977a90cfab6847ed670f7343eb35badada53dcf928400ff99fb16778337afea4ed936502cbcec7d42eb4f76937691ca30b18471a SHA512 105128eb5d127f4f7b6127771054602f55547fc7fa04bdf1135239499b58c9cbaa9222e822ff5eb4e2a319e2f0d06c3d9c3f6de04bc577f5ba1ed66eb3362b45 +AUX pnp4nagios-0.6.26_p20221106_php80.patch 1576 BLAKE2B c11698d80086c3abd2b0cc96ed9af68267ce63c38b35ec87cb2f8f52cbe2d02af8a24dcbbf3d12779af0ae1fed2521b4f784fc0a8fbb0f2a15c51e6efaff4ea8 SHA512 f92a9b384767b7bddea0da504a01486f5145f726cf6eb6dd5f8ac6bff5450e785c78a900d6fd97173043f08dca30336f2ea28069f7a67ee0c982b3d4a2564c45 DIST pnp4nagios-0.6.26.tar.gz 3039265 BLAKE2B 1adb3c41222e6bc93671af955a1564387d77901ce118f5d309d101d88c691140e0feef1c2594bc5db44706ff01505a4fcf99b79b6a0c5b5cb923838dd00f1ff0 SHA512 caf6dcced74967174d9e6f09dd1a5bee17397c10a68d0f577c37dcc836f928d78c20d75a0189539e9ffa93715ab7b6e732e9f36b9698cf4dd9c09cfb65184427 +DIST pnp4nagios-0.6.26_p20221106.tar.gz 3029704 BLAKE2B 5866f4dbfef9b1028255eb3e47ac57fa260c1e2caca50fcb1c5ff93a3dc9bee9f14152e3a269ecf12daab59e50e1f4dfcd6513f9ce3dc5da35de50b944c38260 SHA512 cd0c3ad3d4983c43f7e1a100e8a2e6a530b573ca6bed60125c87b22ab33c2486c5ce99c6f52d641cdc7468984925a22a6ee7e1ac330ea2278ec2439acb910d04 EBUILD pnp4nagios-0.6.26-r11.ebuild 3164 BLAKE2B 0fdda74a183a616f92e666784740f41d985f6c81e5a31ac26f3b31d79f9b98760ed466f6e5285e1c41b6ee051c9a94c03a20090b131402ab5ac05797ad93b83e SHA512 f3d58aec6064bec044f21992b1f652ef74e3d43a3966ed288fff922fa361ff5746edcbaccc6e4bd897747e25760d888726d4f10929f508dab8514b16be55d8ac +EBUILD pnp4nagios-0.6.26_p20221106.ebuild 3359 BLAKE2B 2bee98e9ce9c5c650477a5dd5ac37038a2979bb80764004b1553c833272b7b8c58dc46dcd109c7b876f3eca39c3c8facfe9e5de1ff396993a8616d37a28a20b4 SHA512 39b1024b5e6012fb6ecd701289d4067636ae098cca91e4c217f50df6c4343c5a010a363d3a2fb40bb52f5950387a27621b433b32335399191bec98925fb44d3c MISC metadata.xml 677 BLAKE2B f58a0350bbf34f21834181d537d1e4906c91b9eea8187b10965578fa6fa82abd3de727754b2f62987f078aad6db146ec00a0437c48edd4411b23b1ef780abb0f SHA512 9843fd05d441d4324ceab6f99f67c7eba266b9f6cad7a28616c7ef094bd8345ef573ac4b5f83ee8f049f3dbf3067df1c1005fff803db9560f10f8b05f11fceda diff --git a/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_compat.patch b/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_compat.patch new file mode 100644 index 000000000000..21f9c89ed94f --- /dev/null +++ b/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_compat.patch @@ -0,0 +1,53 @@ +# https://github.com/Tontonitch/pnp4nagios/commits/master + +diff --git a/share/pnp/application/views/graph_content.php b/share/pnp/application/views/graph_content.php +index 3ea99dc0..00469ce0 100644 +--- a/share/pnp/application/views/graph_content.php ++++ b/share/pnp/application/views/graph_content.php +@@ -88,7 +88,8 @@ + # treated like a url fragment when zooming + $gid = array(); + parse_str(ltrim($this->url, '?'), $gid); +- $gid = htmlentities("?host=".urlencode($gid["host"])."&srv=".urlencode($gid["srv"])); ++ $srv = isset($gid['srv']) ? $gid['srv'] : ''; ++ $gid = htmlentities("?host=".urlencode($gid["host"])."&srv=".urlencode($srv)); + + echo "
"; + +diff --git a/share/pnp/application/vendor/fpdf/fpdf.php b/share/pnp/application/vendor/fpdf/fpdf.php +index cfc09593..efb53b4e 100755 +--- a/share/pnp/application/vendor/fpdf/fpdf.php ++++ b/share/pnp/application/vendor/fpdf/fpdf.php +@@ -1040,8 +1040,11 @@ protected function _dochecks() + if(ini_get('mbstring.func_overload') & 2) + $this->Error('mbstring overloading must be disabled'); + // Ensure runtime magic quotes are disabled +- if(get_magic_quotes_runtime()) +- @set_magic_quotes_runtime(0); ++# if(get_magic_quotes_runtime()) ++# @set_magic_quotes_runtime(0); ++ if (PHP_VERSION_ID < 70400 && get_magic_quotes_runtime()) { ++ set_magic_quotes_runtime(0); ++ } + } + + protected function _checkoutput() +diff --git a/share/pnp/application/vendor/fpdf/fpdi_pdf_parser.php b/share/pnp/application/vendor/fpdf/fpdi_pdf_parser.php +index 9e6d521a..c044f200 100755 +--- a/share/pnp/application/vendor/fpdf/fpdi_pdf_parser.php ++++ b/share/pnp/application/vendor/fpdf/fpdi_pdf_parser.php +@@ -305,6 +305,7 @@ protected function _getPageRotation($obj) + } + + $res = $this->_getPageRotation($obj[1][1]['/Parent']); ++ if(false == $res) return false; + if ($res[0] == pdf_parser::TYPE_OBJECT) + return $res[1]; + +@@ -344,4 +345,4 @@ protected function _readPages(&$pages, &$result) + } + } + } +-} +\ No newline at end of file ++} diff --git a/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_php80.patch b/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_php80.patch new file mode 100644 index 000000000000..2407bb6c51e9 --- /dev/null +++ b/net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_php80.patch @@ -0,0 +1,42 @@ +diff --git a/lib/kohana/system/core/utf8.php b/lib/kohana/system/core/utf8.php +index 9f20f42..b349c68 100644 +--- a/lib/kohana/system/core/utf8.php ++++ b/lib/kohana/system/core/utf8.php +@@ -49,17 +49,6 @@ if ( ! extension_loaded('iconv')) + ); + } + +-if (extension_loaded('mbstring') AND (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING)) +-{ +- trigger_error +- ( +- 'The mbstring extension is overloading PHP\'s native string functions. '. +- 'Disable this by setting mbstring.func_overload to 0, 1, 4 or 5 in php.ini or a .htaccess file.'. +- 'This application cannot be run without UTF-8 support.', +- E_USER_ERROR +- ); +-} +- + // Check PCRE support for Unicode properties such as \p and \X. + $ER = error_reporting(0); + define('PCRE_UNICODE_PROPERTIES', (bool) preg_match('/^\pL$/u', 'ñ')); +@@ -740,4 +729,4 @@ final class utf8 { + return _from_unicode($arr); + } + +-} // End utf8 +\ No newline at end of file ++} // End utf8 +diff --git a/share/pnp/application/models/data.php b/share/pnp/application/models/data.php +index 576c8ec..20cdade 100644 +--- a/share/pnp/application/models/data.php ++++ b/share/pnp/application/models/data.php +@@ -266,7 +266,7 @@ class Data_Model extends System_Model + $xml = array(); + if (file_exists($xmlfile)) { + libxml_use_internal_errors(TRUE); +- libxml_clear_errors(TRUE); ++ libxml_clear_errors(); + if(! $xml = simplexml_load_file($xmlfile) ){; + if( $throw_exception == TRUE ){ + $errors = '
'; diff --git a/net-analyzer/pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild new file mode 100644 index 000000000000..1ce42b2d29c9 --- /dev/null +++ b/net-analyzer/pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="A performance data analyzer for nagios" +HOMEPAGE="http://www.pnp4nagios.org/" +GH_COMMIT="5e09f538373ac4310a13355746bb3d3a10eb7bef" +SRC_URI="https://github.com/lingej/pnp4nagios/archive/${GH_COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${GH_COMMIT}" + +LICENSE="GPL-2" +SLOT="0" +IUSE="apache2 icinga +nagios" +KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" + +REQUIRED_USE="^^ ( icinga nagios )" + +# Some things (sync mode, for one) are broken with nagios-4.x, but since +# nagios-3.x has been end-of-life'd, we don't have much choice here but +# to accept it. +DEPEND="net-analyzer/rrdtool[graph,perl] + icinga? ( + acct-group/icinga + acct-user/icinga + ) + nagios? ( + acct-group/nagios + acct-user/nagios + )" + +# A list of modules used in our Apache config file. +APACHE_MODS="apache2_modules_alias," # "Alias" directive +APACHE_MODS+="apache2_modules_authz_core," # "Require" directive +APACHE_MODS+="apache2_modules_rewrite" # "RewriteEngine" and friends + +RDEPEND="${DEPEND} + dev-lang/php:*[filter,gd,json(+),simplexml,xml,zlib] + media-fonts/dejavu + virtual/perl-Getopt-Long + virtual/perl-Time-HiRes + apache2? ( >=www-servers/apache-2.4[${APACHE_MODS}] )" + +PATCHES=( + "${FILESDIR}/${PN}-0.6.14-makefile.patch" + "${FILESDIR}/${PN}-0.6.26_p20221106_compat.patch" + "${FILESDIR}/${PN}-0.6.26_p20221106_php80.patch" +) + +src_configure() { + local user_group=nagios + use icinga && user_group=icinga + + local myeconfargs=( + --sysconfdir="${EPREFIX}"/etc/pnp + --datarootdir="${EPREFIX}"/usr/share/pnp + --localstatedir="${EPREFIX}"/var/lib/pnp + --with-nagios-user="${user_group}" + --with-nagios-group="${user_group}" + --with-perfdata-logfile="${EPREFIX}"/var/log/pnp/process_perfdata.log + ) + + econf "${myeconfargs[@]}" +} + +src_compile() { + # The default target just shows a help + emake all +} + +src_install() { + # Don't use INSTALL_OPTS because they set insecure permissions on + # all of /etc/pnp (https://github.com/lingej/pnp4nagios/issues/140). + emake INSTALL_OPTS="" DESTDIR="${D}" install install-config + einstalldocs + newinitd "${FILESDIR}"/npcd.initd npcd + rm "${ED}/usr/share/pnp/install.php" || \ + die "unable to remove ${ED}/usr/share/pnp/install.php" + + # Fix CVE-2012-3457 (Gentoo bug 430358) + fperms o-rwx /etc/pnp/process_perfdata.cfg + + if use apache2 ; then + insinto /etc/apache2/modules.d + newins "${FILESDIR}"/98_pnp4nagios-2.4.conf 98_pnp4nagios.conf + fi + + # The nagios or icinga user needs to write performance data to the + # perfdata-dir... + local user_group=nagios + use icinga && user_group=icinga + fowners ":${user_group}" /var/lib/pnp/{,perfdata,spool} + fperms g+rwx /var/lib/pnp/{,perfdata,spool} + + # and likewise for its logs... + dodir /var/log/pnp + fowners ":${user_group}" /var/log/pnp + fperms g+rwx /var/log/pnp + + # and its statistics. This one is arguably the responsibility of the + # build system, since process_perfdata.cfg refers to this location. + dodir /var/lib/pnp/stats + fowners ":${user_group}" /var/lib/pnp/stats + fperms g+rwx /var/lib/pnp/stats +} + +pkg_postinst() { + elog "To enable the pnp4nagios web front-end, please visit" + elog "${EROOT}/etc/conf.d/apache2 and add \"-D PNP -D PHP\"" + elog "to APACHE2_OPTS. Then pnp4nagios will be available at," + elog + elog " http://localhost/pnp4nagios" + elog +} -- cgit v1.2.3