summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWebDawg2020-07-02 12:29:11 -0400
committerWebDawg2020-07-02 12:29:11 -0400
commiteb01e19608146fcd2a83ec4399fb603b63f7cb5d (patch)
tree850b11b99ecfee37187df0c578b3811884c92aa5
parente12dcc8473b85300ecc1e4185666de92a6a89fba (diff)
downloadaur-eb01e19608146fcd2a83ec4399fb603b63f7cb5d.tar.gz
added some patches, new version, and now install file with message
-rw-r--r--PKGBUILD14
-rw-r--r--nagiospass.patch12
-rw-r--r--package.patch47
-rw-r--r--phpfix.patch47
-rw-r--r--pnp4nagios.install42
5 files changed, 159 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 8b8c50107f8c..aed8f3effaf6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,9 +1,10 @@
-# Maintainer: Jonathan Steel <jsteel at archlinux.org>
+# Maintainer: Web Dawg <webdawg at gmail.com>
+# Contributor: Jonathan Steel <jsteel at archlinux.org>
# Contributor: Alexsandr Pavlov <kidoz at mail dot ru>
# Contributor: Paul Ezvan <paul@ezvan.fr>
pkgname=pnp4nagios
-pkgver=0.6.25
+pkgver=0.6.26
pkgrel=1
pkgdesc="Nagios addon to create graphs from performance data"
arch=('i686' 'x86_64')
@@ -13,11 +14,18 @@ depends=('perl' 'rrdtool' 'php' 'php-gd' 'libtool')
backup=('etc/httpd/conf/extra/pnp4nagios.conf' 'etc/pnp4nagios/config.php'
'etc/pnp4nagios/config_local.php' 'etc/pnp4nagios/npcd.cfg'
'etc/pnp4nagios/process_perfdata.cfg')
+install=pnp4nagios.install
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
npcd.service)
-md5sums=('0cdd3f77606738883af99e5a08986c70'
+md5sums=('7a71b47f70e4e99d52c3b1df334e0342'
'69f82fa4aeebc8c1164d67e4399c0932')
+prepare() {
+ cd "$pkgname-$pkgver"
+ patch --forward --strip=1 --input="${srcdir}/phpfix.patch"
+ patch --forward --strip=1 --input="${srcdir}/nagiospass.patch"
+}
+
build() {
cd $pkgname-$pkgver
diff --git a/nagiospass.patch b/nagiospass.patch
new file mode 100644
index 000000000000..0e1e66d5eec4
--- /dev/null
+++ b/nagiospass.patch
@@ -0,0 +1,12 @@
+diff --unified --recursive --text pnp4nagios-0.6.26/sample-config/httpd.conf.in pnp4nagios-0.6.26.good/sample-config/httpd.conf.in
+--- pnp4nagios-0.6.26/sample-config/httpd.conf.in 2017-08-21 11:52:37.000000000 -0400
++++ pnp4nagios-0.6.26.good/sample-config/httpd.conf.in 2020-07-02 12:08:08.004555463 -0400
+@@ -11,7 +11,7 @@
+ #
+ AuthName "Nagios Access"
+ AuthType Basic
+- AuthUserFile /usr/local/nagios/etc/htpasswd.users
++ AuthUserFile /etc/nagios/htpasswd.users
+ Require valid-user
+ <IfModule mod_rewrite.c>
+ # Turn on URL rewriting
diff --git a/package.patch b/package.patch
new file mode 100644
index 000000000000..8dd0918a6d2f
--- /dev/null
+++ b/package.patch
@@ -0,0 +1,47 @@
+diff --unified --recursive --text pnp4nagios-0.6.26/lib/kohana/system/libraries/Input.php pnp4nagios-0.6.26.good/lib/kohana/system/libraries/Input.php
+--- pnp4nagios-0.6.26/lib/kohana/system/libraries/Input.php 2020-07-02 11:33:24.255879852 -0400
++++ pnp4nagios-0.6.26.good/lib/kohana/system/libraries/Input.php 2020-07-02 11:29:00.428092290 -0400
+@@ -54,20 +54,19 @@
+ if (Input::$instance === NULL)
+ {
+ // magic_quotes_runtime is enabled
+- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+- if (get_magic_quotes_runtime())
+- {
+- set_magic_quotes_runtime(0);
+- Kohana::log('debug', 'Disable magic_quotes_runtime! It is evil and deprecated: http://php.net/magic_quotes');
+- }
++ if (get_magic_quotes_runtime())
++ {
++ set_magic_quotes_runtime(0);
++ Kohana::log('debug', 'Disable magic_quotes_runtime! It is evil and deprecated: http://php.net/magic_quotes');
++ }
+
+- // magic_quotes_gpc is enabled
+- if (get_magic_quotes_gpc())
+- {
+- $this->magic_quotes_gpc = TRUE;
+- Kohana::log('debug', 'Disable magic_quotes_gpc! It is evil and deprecated: http://php.net/magic_quotes');
+- }
++ // magic_quotes_gpc is enabled
++ if (get_magic_quotes_gpc())
++ {
++ $this->magic_quotes_gpc = TRUE;
++ Kohana::log('debug', 'Disable magic_quotes_gpc! It is evil and deprecated: http://php.net/magic_quotes');
+ }
++
+ // register_globals is enabled
+ if (ini_get('register_globals'))
+ {
+diff --unified --recursive --text pnp4nagios-0.6.26/share/pnp/application/models/data.php pnp4nagios-0.6.26.good/share/pnp/application/models/data.php
+--- pnp4nagios-0.6.26/share/pnp/application/models/data.php 2020-07-02 11:35:55.220333338 -0400
++++ pnp4nagios-0.6.26.good/share/pnp/application/models/data.php 2020-07-02 11:29:00.404758268 -0400
+@@ -976,7 +976,7 @@
+ */
+ public function getFirstPage(){
+ $pages = $this->getPages();
+- if(is_array($pages) && sizeof($pages) > 0 ){
++ if(sizeof($pages) > 0 ){
+ return urldecode($pages[0]);
+ }else{
+ return FALSE;
diff --git a/phpfix.patch b/phpfix.patch
new file mode 100644
index 000000000000..8dd0918a6d2f
--- /dev/null
+++ b/phpfix.patch
@@ -0,0 +1,47 @@
+diff --unified --recursive --text pnp4nagios-0.6.26/lib/kohana/system/libraries/Input.php pnp4nagios-0.6.26.good/lib/kohana/system/libraries/Input.php
+--- pnp4nagios-0.6.26/lib/kohana/system/libraries/Input.php 2020-07-02 11:33:24.255879852 -0400
++++ pnp4nagios-0.6.26.good/lib/kohana/system/libraries/Input.php 2020-07-02 11:29:00.428092290 -0400
+@@ -54,20 +54,19 @@
+ if (Input::$instance === NULL)
+ {
+ // magic_quotes_runtime is enabled
+- if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+- if (get_magic_quotes_runtime())
+- {
+- set_magic_quotes_runtime(0);
+- Kohana::log('debug', 'Disable magic_quotes_runtime! It is evil and deprecated: http://php.net/magic_quotes');
+- }
++ if (get_magic_quotes_runtime())
++ {
++ set_magic_quotes_runtime(0);
++ Kohana::log('debug', 'Disable magic_quotes_runtime! It is evil and deprecated: http://php.net/magic_quotes');
++ }
+
+- // magic_quotes_gpc is enabled
+- if (get_magic_quotes_gpc())
+- {
+- $this->magic_quotes_gpc = TRUE;
+- Kohana::log('debug', 'Disable magic_quotes_gpc! It is evil and deprecated: http://php.net/magic_quotes');
+- }
++ // magic_quotes_gpc is enabled
++ if (get_magic_quotes_gpc())
++ {
++ $this->magic_quotes_gpc = TRUE;
++ Kohana::log('debug', 'Disable magic_quotes_gpc! It is evil and deprecated: http://php.net/magic_quotes');
+ }
++
+ // register_globals is enabled
+ if (ini_get('register_globals'))
+ {
+diff --unified --recursive --text pnp4nagios-0.6.26/share/pnp/application/models/data.php pnp4nagios-0.6.26.good/share/pnp/application/models/data.php
+--- pnp4nagios-0.6.26/share/pnp/application/models/data.php 2020-07-02 11:35:55.220333338 -0400
++++ pnp4nagios-0.6.26.good/share/pnp/application/models/data.php 2020-07-02 11:29:00.404758268 -0400
+@@ -976,7 +976,7 @@
+ */
+ public function getFirstPage(){
+ $pages = $this->getPages();
+- if(is_array($pages) && sizeof($pages) > 0 ){
++ if(sizeof($pages) > 0 ){
+ return urldecode($pages[0]);
+ }else{
+ return FALSE;
diff --git a/pnp4nagios.install b/pnp4nagios.install
new file mode 100644
index 000000000000..b4de708c1f82
--- /dev/null
+++ b/pnp4nagios.install
@@ -0,0 +1,42 @@
+## arg 1: the new package version
+post_install() {
+ echo "
+ A git repo exists now, and someone should make a git package.
+ The patches that I have made, one of them is from there
+
+ See:
+ *https://betanzos.org/gmo/2020/01/13/pnp4nagios-function-get_magic_quotes_runtime-is-deprecated/
+ *https://github.com/lingej/pnp4nagios/issues/148
+
+ pnp4nagios is pretty rough to configure if you do not get what it is.
+ It has a daemon that processes and converts nagios data, and some php
+ to view it.
+
+ I could not get synchronous mode working. I dont know why. Bulk mode
+ is the way to go: http://docs.pnp4nagios.org/pnp-0.6/config
+
+ You make sure to check the user and group in: /etc/pnp4nagios/npcd.cfg
+
+ also systemctl start npcd
+ also systemctl restart httpd
+ but only after you enable modules in php.ini
+
+ remember if you are using php-fpm you have to restart that too, I
+ forgot I was, and it took a while to figure that out
+
+ you also need to
+
+ Include conf/extra/pnp4nagios.conf
+ *I have patched it with the location of password file in aur nagios
+
+ This was a great help too figuring things out:
+ *https://support.nagios.com/kb/article/nagios-core-performance-graphs-using-pnp4nagios-801.html#Arch_Linux
+
+ It helps you understand what php modules have to be installed.
+
+ Once everything is said, and done visit server/pnp4nagios/ ,and see how
+ things look...then you just have to rename install.php to install.php.old
+
+ Good luck!
+ "
+}