summaryrefslogtreecommitdiff
path: root/net-analyzer/pnp4nagios
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/pnp4nagios')
-rw-r--r--net-analyzer/pnp4nagios/Manifest4
-rw-r--r--net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_compat.patch53
-rw-r--r--net-analyzer/pnp4nagios/files/pnp4nagios-0.6.26_p20221106_php80.patch42
-rw-r--r--net-analyzer/pnp4nagios/pnp4nagios-0.6.26_p20221106.ebuild114
4 files changed, 213 insertions, 0 deletions
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 "<div start=".$value['TIMERANGE']['start']." end=".$value['TIMERANGE']['end']." style=\"width:".$value['GRAPH_WIDTH']."px; height:".$value['GRAPH_HEIGHT']."px; position:absolute; top:33px\" class=\"graph\" id=\"".$gid."\" ></div>";
+
+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 <a href="http://php.net/mbstring">mbstring</a> 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 = '<br>';
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
+}