pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/cacti Completing the upgrade to Cacti v1.2.3.
details: https://anonhg.NetBSD.org/pkgsrc/rev/aee5e194d49e
branches: trunk
changeset: 333059:aee5e194d49e
user: hauke <hauke%pkgsrc.org@localhost>
date: Mon Apr 29 16:09:05 2019 +0000
description:
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.
diffstat:
net/cacti/INSTALL | 7 +-
net/cacti/MESSAGE | 47 ++++++--
net/cacti/Makefile | 19 ++-
net/cacti/distinfo | 16 ++-
net/cacti/files/httpd-cacti.conf | 7 +-
net/cacti/patches/patch-cacti.sql | 10 +-
net/cacti/patches/patch-cli_install__cacti.php | 15 ++
net/cacti/patches/patch-include_global__settings.php | 26 ++++-
net/cacti/patches/patch-install_functions.php | 104 +++++++++++++++++++
net/cacti/patches/patch-install_index.php | 35 ------
net/cacti/patches/patch-lib_clog__webapi.php | 15 ++
net/cacti/patches/patch-lib_functions.php | 15 ++
net/cacti/patches/patch-lib_installer.php | 13 ++-
net/cacti/patches/patch-lib_rrd.php | 4 +-
net/cacti/patches/patch-poller__maintenance.php | 13 ++-
net/cacti/patches/patch-utilities.php | 24 ++++
16 files changed, 298 insertions(+), 72 deletions(-)
diffs (truncated from 558 to 300 lines):
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/INSTALL
--- a/net/cacti/INSTALL Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/INSTALL Mon Apr 29 16:09:05 2019 +0000
@@ -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
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/MESSAGE
--- a/net/cacti/MESSAGE Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/MESSAGE Mon Apr 29 16:09:05 2019 +0000
@@ -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 @@
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
+ extension=zlib.so
+ extension=mbstring.so
+ extension=posix.so
-- Append this to Apache webserver's "httpd.conf" and restart the server.
-
- Include etc/httpd/httpd-cacti.conf
+ 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 @@
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 @@
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>.
+
===========================================================================
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/Makefile
--- a/net/cacti/Makefile Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/Makefile Mon Apr 29 16:09:05 2019 +0000
@@ -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 @@
SUBST_CLASSES+= paths
SUBST_STAGE.paths= pre-configure
-SUBST_FILES.paths= ${WRKDIR}/httpd-cacti.conf install/functions.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/installer.php
-SUBST_FILES.paths+= ${WRKDIR}/cacti-poller
+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 @@
${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; \
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/distinfo
--- a/net/cacti/distinfo Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/distinfo Mon Apr 29 16:09:05 2019 +0000
@@ -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
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/files/httpd-cacti.conf
--- a/net/cacti/files/httpd-cacti.conf Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/files/httpd-cacti.conf Mon Apr 29 16:09:05 2019 +0000
@@ -10,8 +10,11 @@
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
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/patches/patch-cacti.sql
--- a/net/cacti/patches/patch-cacti.sql Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/patches/patch-cacti.sql Mon Apr 29 16:09:05 2019 +0000
@@ -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);
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/patches/patch-cli_install__cacti.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/cacti/patches/patch-cli_install__cacti.php Mon Apr 29 16:09:05 2019 +0000
@@ -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;
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/patches/patch-include_global__settings.php
--- a/net/cacti/patches/patch-include_global__settings.php Mon Apr 29 15:53:15 2019 +0000
+++ b/net/cacti/patches/patch-include_global__settings.php Mon Apr 29 16:09:05 2019 +0000
@@ -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 <path_cacti>/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'),
diff -r 7c7293c0771b -r aee5e194d49e net/cacti/patches/patch-install_functions.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/net/cacti/patches/patch-install_functions.php Mon Apr 29 16:09:05 2019 +0000
@@ -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) {
+ );
Home |
Main Index |
Thread Index |
Old Index