pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/cacti



Module Name:    pkgsrc
Committed By:   hauke
Date:           Mon Apr 29 16:09:05 UTC 2019

Modified Files:
        pkgsrc/net/cacti: INSTALL MESSAGE Makefile distinfo
        pkgsrc/net/cacti/files: httpd-cacti.conf
        pkgsrc/net/cacti/patches: patch-cacti.sql
            patch-include_global__settings.php patch-lib_installer.php
            patch-lib_rrd.php patch-poller__maintenance.php
Added Files:
        pkgsrc/net/cacti/patches: patch-cli_install__cacti.php
            patch-install_functions.php patch-lib_clog__webapi.php
            patch-lib_functions.php patch-utilities.php
Removed Files:
        pkgsrc/net/cacti/patches: patch-install_index.php

Log Message:
Completing the upgrade to Cacti v1.2.3.

Funny enough, the previous commit coincided with my own work on a
package upgrade. It brought a few bits and bobs I had been missing,
and my work closes a few of its gaps.

In detail:

INSTALL - set CACTI_USER and APACHE_GROUP properly

MESSAGES - mention newer PHPs' php.d, while updating the extension list
           mention <https://github.com/Cacti/cacti/issues/2621> setup problem

Makefile - add mandatory dependencies: php-{json,zlib,mbstring,posix}
           add patched files to 'paths' substitution

files/httpd-cacti.conf - convert to Apache 2.4 ACL syntax

patches/ - comments, CACTI_LOGDIR substitution

Minor touch-ups everywhere - I am sure there is more to do.

The result pkglints, builds, installs, configures (taking the above
#2621 into account), and runs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/cacti/INSTALL
cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/cacti/MESSAGE
cvs rdiff -u -r1.39 -r1.40 pkgsrc/net/cacti/Makefile
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/cacti/distinfo
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/net/cacti/files/httpd-cacti.conf
cvs rdiff -u -r1.1.1.1 -r1.2 pkgsrc/net/cacti/patches/patch-cacti.sql
cvs rdiff -u -r0 -r1.1 pkgsrc/net/cacti/patches/patch-cli_install__cacti.php \
    pkgsrc/net/cacti/patches/patch-install_functions.php \
    pkgsrc/net/cacti/patches/patch-lib_clog__webapi.php \
    pkgsrc/net/cacti/patches/patch-lib_functions.php \
    pkgsrc/net/cacti/patches/patch-utilities.php
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/net/cacti/patches/patch-include_global__settings.php
cvs rdiff -u -r1.3 -r0 pkgsrc/net/cacti/patches/patch-install_index.php
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/cacti/patches/patch-lib_installer.php \
    pkgsrc/net/cacti/patches/patch-poller__maintenance.php
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/cacti/patches/patch-lib_rrd.php

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/cacti/INSTALL
diff -u pkgsrc/net/cacti/INSTALL:1.2 pkgsrc/net/cacti/INSTALL:1.3
--- pkgsrc/net/cacti/INSTALL:1.2        Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/INSTALL    Mon Apr 29 16:09:05 2019
@@ -1,9 +1,12 @@
-# $NetBSD: INSTALL,v 1.2 2019/04/26 14:52:16 gavan Exp $
+# $NetBSD: INSTALL,v 1.3 2019/04/29 16:09:05 hauke Exp $
 
 case ${STAGE} in
 POST-INSTALL)
        ${TOUCH} @CACTI_LOGDIR@/cacti.log
-       ${CHOWN} cacti:www @CACTI_LOGDIR@/cacti.log
+       ${CHOWN} ${CACTI_USER}:${APACHE_GROUP} @CACTI_LOGDIR@/cacti.log
        ${CHMOD} 660 @CACTI_LOGDIR@/cacti.log
+       ${TOUCH} @CACTI_LOGDIR@/cacti_stderr.log
+       ${CHOWN} ${CACTI_USER}:${APACHE_GROUP} @CACTI_LOGDIR@/cacti_stderr.log
+       ${CHMOD} 660 @CACTI_LOGDIR@/cacti_stderr.log
        ;;
 esac

Index: pkgsrc/net/cacti/MESSAGE
diff -u pkgsrc/net/cacti/MESSAGE:1.6 pkgsrc/net/cacti/MESSAGE:1.7
--- pkgsrc/net/cacti/MESSAGE:1.6        Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/MESSAGE    Mon Apr 29 16:09:05 2019
@@ -1,14 +1,12 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.6 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: MESSAGE,v 1.7 2019/04/29 16:09:05 hauke Exp $
 
-cacti is now installed.
-
-To get cacti up and running asap, you have to complete these steps:
+To get cacti up and running, you have to complete these steps:
 
 - Install & Configure MySQL database server.
 
-- Add a cacti database and cactiuser user to MySQL and create the cacti
-  database layout (${CACTIDIR}/cacti.sql) to MySQL:
+  Add a 'cacti' database and 'cactiuser' user to MySQL and create the
+  cacti database layout (${CACTIDIR}/cacti.sql) to MySQL:
 
        mysql> CREATE DATABASE cacti;
        mysql> GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost'
@@ -18,22 +16,38 @@ To get cacti up and running asap, you ha
         mysql> USE cacti;
         mysql> SOURCE ${CACTIDIR}/cacti.sql;
 
-- If you haven't already imported your MySQL timezone data, you need to do this:
+  If you haven't already imported your MySQL timezone data, you need to run
        mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
 
+ The Cacti Setup Assistant will ask you to set or adjust database
+ parameters in my.cnf.
+
 - Install & Configure an Apache webserver.
 
-- If you have not already done so, add these lines to enable php extensions
-  required by cacti in ${PKG_SYSCONFBASE}/etc/php.ini
+  Append this to Apache webserver's "httpd.conf", and restart the server.
 
+        Include etc/httpd/httpd-cacti.conf
+
+- For older PHP installations that do not support
+  ${PKG_SYSCONFBASE}/php.d/, you will need to manually add these lines
+  to enable php extensions required by cacti in
+  ${PKG_SYSCONFBASE}/php.ini
+
+       extension=gmp.so
+       extension=ldap.so
+       extension=gettext.so
        extension=pdo.so
        extension=pdo_mysql.so
        extension=snmp.so
        extension=sockets.so
-
-- Append this to Apache webserver's "httpd.conf" and restart the server.
-
-       Include etc/httpd/httpd-cacti.conf
+       extension=zlib.so
+       extension=mbstring.so
+       extension=posix.so
+
+  You will want to adjust the following parameters in php.ini
+       memory_limit = 400M (minimum)
+       max_execution_time = 60 (seconds, minimum)
+       date.timezone
 
 - Add the following lines to ${CACTI_USER}'s crontab
 
@@ -42,7 +56,7 @@ To get cacti up and running asap, you ha
 
   and make sure ${PREFIX}/bin is in PATH.
 
-Please read the included documentation (${CACTIDIR}/docs/...),
+Please read the documentation under ${CACTIDIR}/docs/
 for more information about configuring and starting cacti.
 
 If you have updated from a version older than 0.8.8h, note that the
@@ -50,4 +64,11 @@ rrd and log directories are now under ${
 database files need to be moved manually, and you have to update the
 log path in "Console:Settings:Paths:Logging".
 
+Note: During the web setup of v1.2.3, you may get stuck on the page
+"Critical Binary Locations" because of a missing "Cacti Log Path" entry.
+
+Even after entering the proper ${VARBASE}/log/cacti/cacti.log,
+installation may not continue. In this case, using a different browser
+may help, see <https://github.com/Cacti/cacti/issues/2621>.
+
 ===========================================================================

Index: pkgsrc/net/cacti/Makefile
diff -u pkgsrc/net/cacti/Makefile:1.39 pkgsrc/net/cacti/Makefile:1.40
--- pkgsrc/net/cacti/Makefile:1.39      Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/Makefile   Mon Apr 29 16:09:05 2019
@@ -1,22 +1,28 @@
-# $NetBSD: Makefile,v 1.39 2019/04/26 14:52:16 gavan Exp $
+# $NetBSD: Makefile,v 1.40 2019/04/29 16:09:05 hauke Exp $
 
 DISTNAME=      cacti-1.2.3
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  https://www.cacti.net/downloads/
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      https://www.cacti.net/
-COMMENT=       Frontend to rrdtool for monitoring systems and services
+COMMENT=       Web frontend to rrdtool for monitoring systems and services
 LICENSE=       gnu-gpl-v2
 
 USE_LANGUAGES=         # none
 USE_TOOLS+=            pax
 NO_BUILD=              yes
 
+#DEPENDS+=             ${PHP_PKG_PREFIX}-gd-[0-9]*:../../graphics/php-gd
+DEPENDS+=              ${PHP_PKG_PREFIX}-json-[0-9]*:../../textproc/php-json
+DEPENDS+=              ${PHP_PKG_PREFIX}-zlib-[0-9]*:../../archivers/php-zlib
+DEPENDS+=              ${PHP_PKG_PREFIX}-mbstring-[0-9]*:../../converters/php-mbstring
 DEPENDS+=              ${PHP_PKG_PREFIX}-pdo_mysql-[0-9]*:../../databases/php-pdo_mysql
 DEPENDS+=              ${PHP_PKG_PREFIX}-snmp-[0-9]*:../../net/php-snmp
 DEPENDS+=              ${PHP_PKG_PREFIX}-sockets-[0-9]*:../../net/php-sockets
 DEPENDS+=              ${PHP_PKG_PREFIX}-gmp-[0-9]*:../../devel/php-gmp
+DEPENDS+=              ${PHP_PKG_PREFIX}-posix-[0-9]*:../../devel/php-posix
 DEPENDS+=              ${PHP_PKG_PREFIX}-ldap-[0-9]*:../../databases/php-ldap
 DEPENDS+=              ${PHP_PKG_PREFIX}-gettext-[0-9]*:../../devel/php-gettext
 DEPENDS+=              ${APACHE_PKG_PREFIX}-${PHP_PKG_PREFIX}-[0-9]*:../../www/ap-php
@@ -62,10 +68,12 @@ FILES_SUBST+=               CACTI_LOGDIR=${CACTI_LOGD
 
 SUBST_CLASSES+=                paths
 SUBST_STAGE.paths=     pre-configure
-SUBST_FILES.paths=     ${WRKDIR}/httpd-cacti.conf install/functions.php
-SUBST_FILES.paths+=    include/global.php include/global_settings.php
-SUBST_FILES.paths+=    lib/installer.php
+SUBST_FILES.paths=     ${WRKDIR}/httpd-cacti.conf
 SUBST_FILES.paths+=    ${WRKDIR}/cacti-poller
+SUBST_FILES.paths+=    poller_maintenance.php utilities.php
+SUBST_FILES.paths+=    cli/install_cacti.php install/functions.php
+SUBST_FILES.paths+=    include/global.php include/global_settings.php
+SUBST_FILES.paths+=    lib/clog_webapi.php lib/installer.php lib/functions.php
 SUBST_VARS.paths=      CACTIDIR PREFIX CACTI_USER CACTI_LOGDIR CACTI_RRADIR
 SUBST_VARS.paths+=     PKG_PHP_MAJOR_VERS SH
 
@@ -111,6 +119,7 @@ post-extract:
        ${CP} ${FILESDIR}/freebsd_memory.pl ${WRKSRC}/scripts/
        ${CP} ${FILESDIR}/netbsd_memory.pl ${WRKSRC}/scripts/
        ${CP} ${FILESDIR}/solaris_memory.pl ${WRKSRC}/scripts/
+       ${CHMOD} 644 ${WRKSRC}/rra/.htaccess
        cd ${WRKSRC}/scripts;                                   \
        if [ -f ${LOWER_OPSYS}_memory.pl ]; then                \
          ${LN} -fs ${LOWER_OPSYS}_memory.pl local_memory.pl;   \

Index: pkgsrc/net/cacti/distinfo
diff -u pkgsrc/net/cacti/distinfo:1.9 pkgsrc/net/cacti/distinfo:1.10
--- pkgsrc/net/cacti/distinfo:1.9       Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/distinfo   Mon Apr 29 16:09:05 2019
@@ -1,11 +1,17 @@
-$NetBSD: distinfo,v 1.9 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: distinfo,v 1.10 2019/04/29 16:09:05 hauke Exp $
 
 SHA1 (cacti-1.2.3.tar.gz) = 8f9ef47264cd6fcfe3ad2053c9004cd7100127ae
 RMD160 (cacti-1.2.3.tar.gz) = 32e71256b160edf7b57c1a4a906a976911f3c533
 SHA512 (cacti-1.2.3.tar.gz) = 195d71a6eb08770211c30985ea3b96e2c4f84d91f16617a15e84fab0959a91f1f7923462ea931724a60580757662e01b335490f563d50e6e938c313dcf2044d0
 Size (cacti-1.2.3.tar.gz) = 23977004 bytes
+SHA1 (patch-cacti.sql) = 7bdfe92fc5254762ec4f75019ca380754f5867d5
+SHA1 (patch-cli_install__cacti.php) = 76d6fc73607902d1863fdc54c4c98171c2817454
 SHA1 (patch-include_global.php) = c115a912c63617a4821690829b46ba7350e03c6b
-SHA1 (patch-include_global__settings.php) = d7d6cdd7e97fbfbc27a1ba17e99f7684877c810d
-SHA1 (patch-lib_installer.php) = 96a33b125651276559de3e9156948f1d519975a3
-SHA1 (patch-lib_rrd.php) = bbb94a7434f3dd9a54150787566b815432abb6a0
-SHA1 (patch-poller__maintenance.php) = ff18964b976100b49fe795436966630b808a5309
+SHA1 (patch-include_global__settings.php) = 85247ece53fa08c38a6ac70509b0658fb8d4ee0f
+SHA1 (patch-install_functions.php) = 05fb12e1f034043fba8c9ccba0901b602ca5e828
+SHA1 (patch-lib_clog__webapi.php) = f17084d66ef21c4315547c389da6d94795ceeed8
+SHA1 (patch-lib_functions.php) = c29ce98afd2a865d3f307b25003af10bc9e8b13e
+SHA1 (patch-lib_installer.php) = 8d5f23369dc5dcfe8a99a3896a590f8d6f147968
+SHA1 (patch-lib_rrd.php) = 1f97271d4d4832f93b3e312b2d25281d1724aeec
+SHA1 (patch-poller__maintenance.php) = 91ad867cd958835412a652ff50ffb1ad3d1074fa
+SHA1 (patch-utilities.php) = 4a681095225c59f1d9a28408978af7b81a64141a

Index: pkgsrc/net/cacti/files/httpd-cacti.conf
diff -u pkgsrc/net/cacti/files/httpd-cacti.conf:1.1.1.1 pkgsrc/net/cacti/files/httpd-cacti.conf:1.2
--- pkgsrc/net/cacti/files/httpd-cacti.conf:1.1.1.1     Tue Nov 22 22:23:13 2011
+++ pkgsrc/net/cacti/files/httpd-cacti.conf     Mon Apr 29 16:09:05 2019
@@ -10,8 +10,11 @@ Alias /cacti "@CACTIDIR@"
   AllowOverride Limit
   AddHandler application/x-httpd-php .php
   DirectoryIndex index.php
-  Order allow,deny
-  Allow from all
+
+  # Adjust access
+  Require ip 127.0.0.1
+  #Require all granted
+
 </Directory>
 
 # some people prefer a simple URL like http://cacti.example.com

Index: pkgsrc/net/cacti/patches/patch-cacti.sql
diff -u pkgsrc/net/cacti/patches/patch-cacti.sql:1.1.1.1 pkgsrc/net/cacti/patches/patch-cacti.sql:1.2
--- pkgsrc/net/cacti/patches/patch-cacti.sql:1.1.1.1    Tue Nov 22 22:23:13 2011
+++ pkgsrc/net/cacti/patches/patch-cacti.sql    Mon Apr 29 16:09:05 2019
@@ -1,15 +1,15 @@
-$NetBSD: patch-cacti.sql,v 1.1.1.1 2011/11/22 22:23:13 tez Exp $
+$NetBSD: patch-cacti.sql,v 1.2 2019/04/29 16:09:05 hauke Exp $
 
-use a generic scriptname rather than an OS specific one
+Use a generic scriptname for memory stats, rather than an OS specific one
 
---- cacti.sql.orig     2011-09-26 20:41:03.000000000 +0000
+--- cacti.sql.orig     2019-03-30 23:40:22.000000000 +0000
 +++ cacti.sql
-@@ -195,7 +195,7 @@ INSERT INTO data_input VALUES (2,'bf566c
+@@ -1074,7 +1074,7 @@ INSERT INTO data_input VALUES (2,'bf566c
  INSERT INTO data_input VALUES (3,'274f4685461170b9eb1b98d22567ab5e','Unix - Get Free Disk Space','<path_cacti>/scripts/diskfree.sh <partition>',1);
  INSERT INTO data_input VALUES (4,'95ed0993eb3095f9920d431ac80f4231','Unix - Get Load Average','perl <path_cacti>/scripts/loadavg_multi.pl',1);
  INSERT INTO data_input VALUES (5,'79a284e136bb6b061c6f96ec219ac448','Unix - Get Logged In Users','perl <path_cacti>/scripts/unix_users.pl <username>',1);
 -INSERT INTO data_input VALUES (6,'362e6d4768937c4f899dd21b91ef0ff8','Linux - Get Memory Usage','perl <path_cacti>/scripts/linux_memory.pl <grepstr>',1);
-+INSERT INTO data_input VALUES (6,'362e6d4768937c4f899dd21b91ef0ff8','Linux - Get Memory Usage','perl <path_cacti>/scripts/local_memory.pl <grepstr>',1);
++INSERT INTO data_input VALUES (6,'362e6d4768937c4f899dd21b91ef0ff8','Unix - Get Memory Usage','perl <path_cacti>/scripts/local_memory.pl <grepstr>',1);
  INSERT INTO data_input VALUES (7,'a637359e0a4287ba43048a5fdf202066','Unix - Get System Processes','perl <path_cacti>/scripts/unix_processes.pl',1);
  INSERT INTO data_input VALUES (8,'47d6bfe8be57a45171afd678920bd399','Unix - Get TCP Connections','perl <path_cacti>/scripts/unix_tcp_connections.pl <grepstr>',1);
  INSERT INTO data_input VALUES (9,'cc948e4de13f32b6aea45abaadd287a3','Unix - Get Web Hits','perl <path_cacti>/scripts/webhits.pl <log_path>',1);

Index: pkgsrc/net/cacti/patches/patch-include_global__settings.php
diff -u pkgsrc/net/cacti/patches/patch-include_global__settings.php:1.2 pkgsrc/net/cacti/patches/patch-include_global__settings.php:1.3
--- pkgsrc/net/cacti/patches/patch-include_global__settings.php:1.2     Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/patches/patch-include_global__settings.php Mon Apr 29 16:09:05 2019
@@ -1,9 +1,31 @@
-$NetBSD: patch-include_global__settings.php,v 1.2 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: patch-include_global__settings.php,v 1.3 2019/04/29 16:09:05 hauke Exp $
 
-make log directory configurable by package variable
+make log and rrd directories configurable by package variable
 
 --- include/global_settings.php.orig   2019-03-30 23:40:22.000000000 +0000
 +++ include/global_settings.php
+@@ -160,10 +160,10 @@ $settings = array(
+                       ),
+               'path_cactilog' => array(
+                       'friendly_name' => __('Cacti Log Path'),
+-                      'description' => __('The path to your Cacti log file (if blank, defaults to &lt;path_cacti&gt;/log/cacti.log)'),
++                      'description' => __('The path to your Cacti log file (if blank, defaults to @CACTI_LOGDIR@/cacti.log)'),
+                       'method' => 'filepath',
+                       'file_type' => 'ascii',
+-                      'default' => $config['base_path'] . '/log/cacti.log',
++                      'default' => '@CACTI_LOGDIR@' . '/cacti.log',
+                       'max_length' => '255',
+                       'install_check' => 'writable'
+                       ),
+@@ -172,7 +172,7 @@ $settings = array(
+                       'description' => __('If you are having issues with Cacti\'s Data Collectors, set this file path and the Data Collectors standard error will be redirected to this file'),
+                       'method' => 'filepath',
+                       'file_type' => 'ascii',
+-                      'default' => $config['base_path'] . '/log/cacti_stderr.log',
++                      'default' => '@CACTI_LOGDIR@' . '/cacti_stderr.log',
+                       'max_length' => '255',
+                       'install_check' => 'writable',
+                       'install_optional' => true
 @@ -243,7 +243,7 @@ $settings = array(
                        'friendly_name' => __('Archive directory'),
                        'description' => __('This is the directory where RRDfiles are <strong>moved</strong> for archiving'),

Index: pkgsrc/net/cacti/patches/patch-lib_installer.php
diff -u pkgsrc/net/cacti/patches/patch-lib_installer.php:1.1 pkgsrc/net/cacti/patches/patch-lib_installer.php:1.2
--- pkgsrc/net/cacti/patches/patch-lib_installer.php:1.1        Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/patches/patch-lib_installer.php    Mon Apr 29 16:09:05 2019
@@ -1,4 +1,6 @@
-$NetBSD: patch-lib_installer.php,v 1.1 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: patch-lib_installer.php,v 1.2 2019/04/29 16:09:05 hauke Exp $
+
+Make log directory configurable by package variable
 
 --- lib/installer.php.orig     2019-03-30 23:40:23.000000000 +0000
 +++ lib/installer.php
@@ -11,3 +13,12 @@ $NetBSD: patch-lib_installer.php,v 1.1 2
                        $config['base_path'] . '/cache/boost',
                        $config['base_path'] . '/cache/mibcache',
                        $config['base_path'] . '/cache/realtime',
+@@ -3184,7 +3184,7 @@ class Installer implements JsonSerializa
+ 
+       public static function getInstallLog() {
+               global $config;
+-              $logcontents = tail_file($config['base_path'] . '/log/cacti.log', 100, -1, ' INSTALL:' , 1, $total_rows);
++              $logcontents = tail_file('@CACTI_LOGDIR@' . '/cacti.log', 100, -1, ' INSTALL:' , 1, $total_rows);
+ 
+               $output_log = '';
+               foreach ($logcontents as $logline) {
Index: pkgsrc/net/cacti/patches/patch-poller__maintenance.php
diff -u pkgsrc/net/cacti/patches/patch-poller__maintenance.php:1.1 pkgsrc/net/cacti/patches/patch-poller__maintenance.php:1.2
--- pkgsrc/net/cacti/patches/patch-poller__maintenance.php:1.1  Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/patches/patch-poller__maintenance.php      Mon Apr 29 16:09:05 2019
@@ -1,7 +1,18 @@
-$NetBSD: patch-poller__maintenance.php,v 1.1 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: patch-poller__maintenance.php,v 1.2 2019/04/29 16:09:05 hauke Exp $
+
+Make rrd directory configurable by package variable
 
 --- poller_maintenance.php.orig        2019-03-30 23:40:23.000000000 +0000
 +++ poller_maintenance.php
+@@ -227,7 +227,7 @@ function logrotate_rotatenow() {
+       $logs = array();
+       $log = read_config_option('path_cactilog');
+       if (empty($log)) {
+-              $log = $config['base_path'] . '/log/cacti.log';
++              $log = '@CACTI_LOGDIR@' . '/cacti.log';
+       }
+       $logs['Cacti'] = $log;
+ 
 @@ -439,7 +439,7 @@ function remove_files($file_array) {
        if (isset ($config['rra_path'])) {
                $rra_path = $config['rra_path'];

Index: pkgsrc/net/cacti/patches/patch-lib_rrd.php
diff -u pkgsrc/net/cacti/patches/patch-lib_rrd.php:1.3 pkgsrc/net/cacti/patches/patch-lib_rrd.php:1.4
--- pkgsrc/net/cacti/patches/patch-lib_rrd.php:1.3      Fri Apr 26 14:52:16 2019
+++ pkgsrc/net/cacti/patches/patch-lib_rrd.php  Mon Apr 29 16:09:05 2019
@@ -1,4 +1,6 @@
-$NetBSD: patch-lib_rrd.php,v 1.3 2019/04/26 14:52:16 gavan Exp $
+$NetBSD: patch-lib_rrd.php,v 1.4 2019/04/29 16:09:05 hauke Exp $
+
+Make rrd directory configurable by package variable
 
 --- lib/rrd.php.orig   2019-03-30 23:40:23.000000000 +0000
 +++ lib/rrd.php

Added files:

Index: pkgsrc/net/cacti/patches/patch-cli_install__cacti.php
diff -u /dev/null pkgsrc/net/cacti/patches/patch-cli_install__cacti.php:1.1
--- /dev/null   Mon Apr 29 16:09:05 2019
+++ pkgsrc/net/cacti/patches/patch-cli_install__cacti.php       Mon Apr 29 16:09:05 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-cli_install__cacti.php,v 1.1 2019/04/29 16:09:05 hauke Exp $
+
+Make log directory configurable by package variable
+
+--- cli/install_cacti.php.orig 2019-03-30 23:40:22.000000000 +0000
++++ cli/install_cacti.php
+@@ -364,7 +364,7 @@ function display_help () {
+       print '  Note: reusing an option_key will replace its value with the last one' . PHP_EOL;
+       print '        specified.' .PHP_EOL . PHP_EOL;
+       print '       --path             - Sets path locations. Example: ' . PHP_EOL;
+-      print '                              --path=cactilog:/usr/share/cacti/log/cacti.log' . PHP_EOL;
++      print '                              --path=cactilog:@CACTI_LOGDIR@/cacti.log' . PHP_EOL;
+       print '                              --path=cactilog:c:\cacti\log\cacti.log' . PHP_EOL;
+       print '                            Prefix: path_' . PHP_EOL;
+       print PHP_EOL;
Index: pkgsrc/net/cacti/patches/patch-install_functions.php
diff -u /dev/null pkgsrc/net/cacti/patches/patch-install_functions.php:1.1
--- /dev/null   Mon Apr 29 16:09:05 2019
+++ pkgsrc/net/cacti/patches/patch-install_functions.php        Mon Apr 29 16:09:05 2019
@@ -0,0 +1,104 @@
+$NetBSD: patch-install_functions.php,v 1.1 2019/04/29 16:09:05 hauke Exp $
+
+Find utilites in PREFIX first.
+Make log directory configurable by package variable
+
+--- install/functions.php.orig 2019-03-30 23:40:23.000000000 +0000
++++ install/functions.php
+@@ -298,8 +298,8 @@ function find_best_path($binary_name) {
+               );
+       } else {
+               $search_paths = array(
+-                      '/bin',
+-                      '/sbin',
++                      '@PREFIX@/bin',
++                      '@PREFIX@/sbin',
+                       '/usr/bin',
+                       '/usr/sbin',
+                       '/usr/local/bin',
+@@ -475,42 +475,42 @@ function install_file_paths() {
+       /* RRDtool Binary Path */
+       $input['path_rrdtool'] = install_tool_path('rrdtool',
+               array(
+-                      'unix'  => '/usr/local/bin/rrdtool',
++                      'unix'  => '@PREFIX@/bin/rrdtool',
+                       'win32' => 'c:/rrdtool/rrdtool.exe'
+               ));
+ 
+       /* snmpwalk Binary Path */
+       $input['path_snmpwalk'] = install_tool_path('snmpwalk',
+               array(
+-                      'unix'  => '/usr/local/bin/snmpwalk',
++                      'unix'  => '@PREFIX@/bin/snmpwalk',
+                       'win32' => 'c:/net-snmp/bin/snmpwalk.exe'
+               ));
+ 
+       /* snmpget Binary Path */
+       $input['path_snmpget'] = install_tool_path('snmpget',
+               array(
+-                      'unix'  => '/usr/local/bin/snmpget',
++                      'unix'  => '@PREFIX@/bin/snmpget',
+                       'win32' => 'c:/net-snmp/bin/snmpget.exe'
+               ));
+ 
+       /* snmpbulkwalk Binary Path */
+       $input['path_snmpbulkwalk'] = install_tool_path('snmpbulkwalk',
+               array(
+-                      'unix'  => '/usr/local/bin/snmpbulkwalk',
++                      'unix'  => '@PREFIX@/bin/snmpbulkwalk',
+                       'win32' => 'c:/net-snmp/bin/snmpbulkwalk.exe'
+               ));
+ 
+       /* snmpgetnext Binary Path */
+       $input['path_snmpgetnext'] = install_tool_path('snmpgetnext',
+               array(
+-                      'unix'  => '/usr/local/bin/snmpgetnext',
++                      'unix'  => '@PREFIX@/bin/snmpgetnext',
+                       'win32' => 'c:/net-snmp/bin/snmpgetnext.exe'
+               ));
+ 
+       /* snmptrap Binary Path */
+       $input['path_snmptrap'] = install_tool_path('snmptrap',
+               array(
+-                      'unix'  => '/usr/local/bin/snmptrap',
++                      'unix'  => '@PREFIX@/bin/snmptrap',
+                       'win32' => 'c:/net-snmp/bin/snmptrap.exe'
+               ));
+ 
+@@ -523,7 +523,7 @@ function install_file_paths() {
+       /* spine Binary Path */
+       $input['path_spine'] = install_tool_path('spine',
+               array(
+-                      'unix'  => '/usr/local/spine/bin/spine',
++                      'unix'  => '@PREFIX@/bin/spine',
+                       'win32' => 'c:/spine/bin/spine.exe'
+               ));
+ 
+@@ -533,7 +533,7 @@ function install_file_paths() {
+       if (!config_value_exists('path_cactilog')) {
+               $input['path_cactilog'] = $settings['path']['path_cactilog'];
+               if (empty($input['path_cactilog']['default'])) {
+-                      $input['path_cactilog']['default'] = $config['base_path'] . '/log/cacti.log';
++                      $input['path_cactilog']['default'] = '@CACTI_LOGDIR@' . '/cacti.log';
+               }
+       } else {
+               $input['path_cactilog'] = $settings['path']['path_cactilog'];
+@@ -544,7 +544,7 @@ function install_file_paths() {
+       if (!config_value_exists('path_cactilog')) {
+               $input['path_stderrlog'] = $settings['path']['path_stderrlog'];
+               if (empty($input['path_stderrlog']['default'])) {
+-                      $input['path_stderrlog']['default'] = $config['base_path'] . '/log/cacti.stderr.log';
++                      $input['path_stderrlog']['default'] = '@CACTI_LOGDIR@' . '/cacti.stderr.log';
+               }
+       } else {
+               $input['path_stderrlog'] = $settings['path']['path_stderrlog'];
+@@ -802,7 +802,7 @@ function log_install_to_file($section, $
+                       $section = 'general';
+               }
+               $logfile = 'install' . '-' . $section;
+-              file_put_contents($config['base_path'] . '/log/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
+-              file_put_contents($config['base_path'] . '/log/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
++              file_put_contents('@CACTI_LOGDIR@' . '/' . $logfile . '.log', sprintf($format_log1, $day, $time, $levelname, $data, PHP_EOL), $flags);
++              file_put_contents('@CACTI_LOGDIR@' . '/install-complete.log', sprintf($format_log2, $day, $time, $sectionname, $levelname, $data, PHP_EOL), $flags);
+       }
+ }
Index: pkgsrc/net/cacti/patches/patch-lib_clog__webapi.php
diff -u /dev/null pkgsrc/net/cacti/patches/patch-lib_clog__webapi.php:1.1
--- /dev/null   Mon Apr 29 16:09:05 2019
+++ pkgsrc/net/cacti/patches/patch-lib_clog__webapi.php Mon Apr 29 16:09:05 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_clog__webapi.php,v 1.1 2019/04/29 16:09:05 hauke Exp $
+
+Make log directory configurable by package variable
+
+--- lib/clog_webapi.php.orig   2019-03-30 23:40:23.000000000 +0000
++++ lib/clog_webapi.php
+@@ -56,7 +56,7 @@ function clog_validate_filename(&$file, 
+       $logbase = basename($logfile);
+ 
+       if ($logfile == '') {
+-              $logfile = $config['base_path'] . '/log/cacti.log';
++              $logfile = '@CACTI_LOGDIR@' . '/cacti.log';
+       }
+ 
+       $errfile = read_config_option('path_stderrlog');
Index: pkgsrc/net/cacti/patches/patch-lib_functions.php
diff -u /dev/null pkgsrc/net/cacti/patches/patch-lib_functions.php:1.1
--- /dev/null   Mon Apr 29 16:09:05 2019
+++ pkgsrc/net/cacti/patches/patch-lib_functions.php    Mon Apr 29 16:09:05 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_functions.php,v 1.1 2019/04/29 16:09:05 hauke Exp $
+
+Make log directory configurable by package variable
+
+--- lib/functions.php.orig     2019-03-30 23:40:23.000000000 +0000
++++ lib/functions.php
+@@ -832,7 +832,7 @@ function cacti_log_file() {
+       global $config;
+       $logfile        = read_config_option('path_cactilog');
+       if ($logfile == '') {
+-              $logfile = $config['base_path'] . '/log/cacti.log';
++              $logfile = '@CACTI_LOGDIR@' . '/cacti.log';
+       }
+       $config['log_path'] = $logfile;
+       return $logfile;
Index: pkgsrc/net/cacti/patches/patch-utilities.php
diff -u /dev/null pkgsrc/net/cacti/patches/patch-utilities.php:1.1
--- /dev/null   Mon Apr 29 16:09:05 2019
+++ pkgsrc/net/cacti/patches/patch-utilities.php        Mon Apr 29 16:09:05 2019
@@ -0,0 +1,24 @@
+$NetBSD: patch-utilities.php,v 1.1 2019/04/29 16:09:05 hauke Exp $
+
+Make log directory configurable by package variable
+
+--- utilities.php.orig 2019-03-30 23:40:23.000000000 +0000
++++ utilities.php
+@@ -917,7 +917,7 @@ function utilities_view_logfile() {
+       }
+ 
+       if ($logfile == '') {
+-              $logfile = $config['base_path'] . '/log/cacti.log';
++              $logfile = '@CACTI_LOGDIR@' . '/cacti.log';
+       }
+ 
+       if (get_nfilter_request_var('filename') != '') {
+@@ -1260,7 +1260,7 @@ function utilities_clear_logfile() {
+       $logfile = read_config_option('path_cactilog');
+ 
+       if ($logfile == '') {
+-              $logfile = './log/cacti.log';
++              $logfile = './cacti.log';
+       }
+ 
+       html_start_box(__('Clear Cacti Log'), '100%', '', '3', 'center', '');



Home | Main Index | Thread Index | Old Index