aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2014-08-15 10:43:41 +0000
committerKurt Jaeger <pi@FreeBSD.org>2014-08-15 10:43:41 +0000
commit93c6b9fcfd4a91c0f119b53f1e62b9e67a392cf8 (patch)
tree58b56f13653ed75a789a41794e841a4fc367e7b6 /net-mgmt
parent69f43aff5e21059c6dca6cc38c07d8c5fe89d5da (diff)
downloadports-93c6b9fcfd4a91c0f119b53f1e62b9e67a392cf8.tar.gz
ports-93c6b9fcfd4a91c0f119b53f1e62b9e67a392cf8.zip
net-mgmt/cacti: add stage support
PR: 192618 Submitted by: Dennis Glatting <freebsd@pki2.com>
Notes
Notes: svn path=/head/; revision=364957
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/cacti/Makefile41
-rw-r--r--net-mgmt/cacti/distinfo2
-rw-r--r--net-mgmt/cacti/files/patch-include__global.php11
-rw-r--r--net-mgmt/cacti/files/patch-include__global_settings.php14
-rw-r--r--net-mgmt/cacti/files/patch-install__index.php11
-rw-r--r--net-mgmt/cacti/files/patch-lib__rrd.php (renamed from net-mgmt/cacti/files/patch-lib-rrd.php)6
-rw-r--r--net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__diskfree.pl (renamed from net-mgmt/cacti/files/patch-scripts-diskfree.pl)7
-rw-r--r--net-mgmt/cacti/files/patch-scripts__linux_memory.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__loadavg.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__ping.pl (renamed from net-mgmt/cacti/files/patch-scripts-ping.pl)10
-rw-r--r--net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__unix_processes.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__unix_users.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__weatherbug.pl8
-rw-r--r--net-mgmt/cacti/files/patch-scripts__webhits.pl8
-rw-r--r--net-mgmt/cacti/files/pkg-install.in51
-rw-r--r--net-mgmt/cacti/files/pkg-message.in82
-rw-r--r--net-mgmt/cacti/pkg-plist20
21 files changed, 227 insertions, 108 deletions
diff --git a/net-mgmt/cacti/Makefile b/net-mgmt/cacti/Makefile
index 1241dc4f1cdc..1bfc0a305f6d 100644
--- a/net-mgmt/cacti/Makefile
+++ b/net-mgmt/cacti/Makefile
@@ -1,18 +1,15 @@
-# Created by: Vincent Tantardini <vinc@freebsd-fr.org>
# $FreeBSD$
PORTNAME= cacti
PORTVERSION= 0.8.8b${PATCHLEVEL}
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= net-mgmt www
MASTER_SITES= http://www.cacti.net/downloads/
-DISTNAME= ${PORTNAME}-${SITEDISTVERSION}
# Vendor's patches
PATCH_SITES= http://www.cacti.net/downloads/patches/${SITEDISTVERSION}/
-PATCHFILES=
+PATCHFILES= security.patch
PATCH_DIST_STRIP= -p1
-PATCHLEVEL=
MAINTAINER= ports@FreeBSD.org
COMMENT= Web-driven graphing interface for RRDTool
@@ -28,35 +25,35 @@ USE_PHP= mysql pcre session sockets snmp xml
WANT_PHP_WEB= yes
NO_BUILD= yes
PKGMESSAGE= ${WRKDIR}/pkg-message
-PKGINSTALL= ${WRKDIR}/pkg-install
-SUB_FILES= pkg-message pkg-install
+SUB_FILES= pkg-message
CACTIDIR?= share/cacti
CACTIUSER?= cacti
-CACTIGROUP?= ${CACTIUSER}
+CACTIGROUP?= cacti
+
+USERS?= ${CACTIUSER}
+GROUPS?= ${CACTIGROUP}
+
WRKSRC= ${WRKDIR}/${PORTNAME}-${SITEDISTVERSION}
SITEDISTVERSION= ${PORTVERSION:S/${PATCHLEVEL}$//}
-PLIST_SUB+= CACTIDIR=${CACTIDIR}
+PLIST_SUB+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
+ CACTIGROUP=${CACTIGROUP}
SUB_LIST+= CACTIDIR=${CACTIDIR} CACTIUSER=${CACTIUSER} \
CACTIGROUP=${CACTIGROUP}
-NO_STAGE= yes
post-patch:
@${FIND} ${WRKSRC} -name \*.orig -delete; \
- ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.orig
-
-pre-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+ ${MV} ${WRKSRC}/include/config.php ${WRKSRC}/include/config.php.sample
+ ${RM} -r ${WRKSRC}/log ${WRKSRC}/rra
do-install:
- @${MKDIR} ${PREFIX}/${CACTIDIR}; \
- ${CP} -R ${WRKSRC}/* ${PREFIX}/${CACTIDIR}/; \
- if [ ! -f ${PREFIX}/${CACTIDIR}/include/config.php ]; then \
- ${CP} ${PREFIX}/${CACTIDIR}/include/config.php.orig \
- ${PREFIX}/${CACTIDIR}/include/config.php; \
- fi; \
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/${CACTIDIR}
+ ${MKDIR} ${STAGEDIR}/var/log/cacti
+ ${MKDIR} ${STAGEDIR}/var/db/cacti/rra
+ ${MKDIR} ${STAGEDIR}/var/db/cacti/scripts
+ ${CP} -R ${WRKSRC}/* ${STAGEDIR}/${PREFIX}/${CACTIDIR}
if [ -f ${PREFIX}/${CACTIDIR}/include/db-settings.php ]; then \
${ECHO_CMD} "======================================================================="; \
${ECHO_CMD} "WARNING! You have to move DB settings from"; \
@@ -64,8 +61,4 @@ do-install:
${ECHO_CMD} "${PREFIX}/${CACTIDIR}/include/config.php and remove db-settings.php"; \
fi
-post-install:
- @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
- @${CAT} ${PKGMESSAGE}
-
.include <bsd.port.mk>
diff --git a/net-mgmt/cacti/distinfo b/net-mgmt/cacti/distinfo
index 0ac68d7ccae4..2e15cac6fac0 100644
--- a/net-mgmt/cacti/distinfo
+++ b/net-mgmt/cacti/distinfo
@@ -1,2 +1,4 @@
SHA256 (cacti-0.8.8b.tar.gz) = ef0e2a813139e0b4c2e066f0fdae1f4ad086bef0aa23446055df6331cb1af98c
SIZE (cacti-0.8.8b.tar.gz) = 2272130
+SHA256 (security.patch) = 73758bdf3f7846875f1620c35d1d982fa27366b053d8bd87363c618e7747c163
+SIZE (security.patch) = 6909
diff --git a/net-mgmt/cacti/files/patch-include__global.php b/net-mgmt/cacti/files/patch-include__global.php
new file mode 100644
index 000000000000..5e04fdcae7db
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-include__global.php
@@ -0,0 +1,11 @@
+--- ./include/global.php.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./include/global.php 2014-08-11 18:37:08.000000000 -0700
+@@ -113,7 +113,7 @@
+ $config["library_path"] = preg_replace("/(.*[\/])include/", "\\1lib", dirname(__FILE__));
+ }
+ $config["include_path"] = dirname(__FILE__);
+-$config["rra_path"] = $config["base_path"] . '/rra';
++$config["rra_path"] = '/var/db/cacti/rra';
+
+ /* colors */
+ $colors["dark_outline"] = "454E53";
diff --git a/net-mgmt/cacti/files/patch-include__global_settings.php b/net-mgmt/cacti/files/patch-include__global_settings.php
new file mode 100644
index 000000000000..509317198b79
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-include__global_settings.php
@@ -0,0 +1,14 @@
+--- ./include/global_settings.php.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./include/global_settings.php 2014-08-11 18:37:08.000000000 -0700
+@@ -96,9 +96,9 @@
+ ),
+ "path_cactilog" => array(
+ "friendly_name" => "Cacti Log File 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 /var/log/cacti.log)",
+ "method" => "filepath",
+- "default" => $config["base_path"] . "/log/cacti.log",
++ "default" => "/var/log/cacti/cacti.log",
+ "max_length" => "255"
+ ),
+ "pollerpaths_header" => array(
diff --git a/net-mgmt/cacti/files/patch-install__index.php b/net-mgmt/cacti/files/patch-install__index.php
new file mode 100644
index 000000000000..8b7070adaeba
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-install__index.php
@@ -0,0 +1,11 @@
+--- ./install/index.php.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./install/index.php 2014-08-11 18:45:19.000000000 -0700
+@@ -267,7 +267,7 @@
+ if (config_value_exists("path_cactilog")) {
+ $input["path_cactilog"]["default"] = read_config_option("path_cactilog");
+ } else {
+- $input["path_cactilog"]["default"] = $config["base_path"] . "/log/cacti.log";
++ $input["path_cactilog"]["default"] = "/var/log/cacti/cacti.log";
+ }
+
+ /* SNMP Version */
diff --git a/net-mgmt/cacti/files/patch-lib-rrd.php b/net-mgmt/cacti/files/patch-lib__rrd.php
index 422880209392..52a81c3ba6a0 100644
--- a/net-mgmt/cacti/files/patch-lib-rrd.php
+++ b/net-mgmt/cacti/files/patch-lib__rrd.php
@@ -1,7 +1,5 @@
-Index: ./lib/rrd.php
-===================================================================
---- ./lib/rrd.php (Revision 7407)
-+++ ./lib/rrd.php (Arbeitskopie)
+--- ./lib/rrd.php.orig 2014-08-11 17:34:23.000000000 -0700
++++ ./lib/rrd.php 2014-08-11 17:34:23.000000000 -0700
@@ -1343,20 +1343,20 @@
$need_rrd_nl = TRUE;
diff --git a/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl b/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl
new file mode 100644
index 000000000000..9c6d36d9c50b
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl
@@ -0,0 +1,8 @@
+--- ./scripts/3com_cable_modem.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/3com_cable_modem.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ open(PROCESS, "/bin/bash -c 'wget --quiet -O - http://192.168.100.1/cgibin/opcfg | grep \"10.18.18.11\" -c' |");
+ $status = <PROCESS>;
diff --git a/net-mgmt/cacti/files/patch-scripts-diskfree.pl b/net-mgmt/cacti/files/patch-scripts__diskfree.pl
index eeea6e5c971c..8f83817deec6 100644
--- a/net-mgmt/cacti/files/patch-scripts-diskfree.pl
+++ b/net-mgmt/cacti/files/patch-scripts__diskfree.pl
@@ -1,8 +1,9 @@
---- cacti-0.8.6j/scripts/diskfree.pl.orig Wed Jan 4 06:08:30 2006
-+++ cacti-0.8.6j/scripts/diskfree.pl Fri Jan 6 00:16:58 2006
+--- ./scripts/diskfree.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/diskfree.pl 2014-08-11 17:34:23.000000000 -0700
@@ -1,5 +1,5 @@
- #!/usr/bin/perl
+-#!/usr/bin/perl
-open(PROCESS,"df --block-size=1024 -P $ARGV[0] | grep -v Filesystem |");
++#!/usr/local/bin/perl
+open(PROCESS,"df -k $ARGV[0] | grep -v Filesystem |");
foreach (<PROCESS>) {
if ($_ =~ /($ARGV[0])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])(.* )(.*[0-9])%(.* )/) {
diff --git a/net-mgmt/cacti/files/patch-scripts__linux_memory.pl b/net-mgmt/cacti/files/patch-scripts__linux_memory.pl
new file mode 100644
index 000000000000..79eb27b95e4f
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__linux_memory.pl
@@ -0,0 +1,8 @@
+--- ./scripts/linux_memory.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/linux_memory.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ open(PROCESS, "cat /proc/meminfo | grep -w $ARGV[0] |");
+ foreach (<PROCESS>) {
diff --git a/net-mgmt/cacti/files/patch-scripts__loadavg.pl b/net-mgmt/cacti/files/patch-scripts__loadavg.pl
new file mode 100644
index 000000000000..78d57891d428
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__loadavg.pl
@@ -0,0 +1,8 @@
+--- ./scripts/loadavg.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/loadavg.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ #get load avg for 5;15;30 min
+ open(PROCESS,"uptime |");
diff --git a/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl b/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl
new file mode 100644
index 000000000000..33c6a1454bc0
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl
@@ -0,0 +1,8 @@
+--- ./scripts/loadavg_multi.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/loadavg_multi.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ #get load avg for 1;5;10 min
+ open(PROCESS, "uptime |");
diff --git a/net-mgmt/cacti/files/patch-scripts-ping.pl b/net-mgmt/cacti/files/patch-scripts__ping.pl
index 394c2526768a..c17f4d38588d 100644
--- a/net-mgmt/cacti/files/patch-scripts-ping.pl
+++ b/net-mgmt/cacti/files/patch-scripts__ping.pl
@@ -1,5 +1,11 @@
---- ./scripts/ping.pl.orig 2011-10-26 09:31:56.000000000 -0400
-+++ ./scripts/ping.pl 2011-10-26 09:32:02.000000000 -0400
+--- ./scripts/ping.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/ping.pl 2014-08-11 17:34:23.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ # take care for tcp:hostname or TCP:ip@
+ $host = $ARGV[0];
@@ -6,7 +6,7 @@
# old linux version use "icmp_seq"
diff --git a/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl b/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl
new file mode 100644
index 000000000000..37ac965ae44c
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl
@@ -0,0 +1,8 @@
+--- ./scripts/query_unix_partitions.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/query_unix_partitions.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ if (($ARGV[0] ne "query") && ($ARGV[0] ne "get") && ($ARGV[0] ne "index") && ($ARGV[0] ne "num_indexes")) {
+ print "usage:\n\n";
diff --git a/net-mgmt/cacti/files/patch-scripts__unix_processes.pl b/net-mgmt/cacti/files/patch-scripts__unix_processes.pl
new file mode 100644
index 000000000000..3e216cd4ec03
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__unix_processes.pl
@@ -0,0 +1,8 @@
+--- ./scripts/unix_processes.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/unix_processes.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ open(PROCESS, "ps ax | grep -c : |");
+ $output = <PROCESS>;
diff --git a/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl b/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl
new file mode 100644
index 000000000000..48a9a437fe3c
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl
@@ -0,0 +1,8 @@
+--- ./scripts/unix_tcp_connections.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/unix_tcp_connections.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ my $grep_string = $ARGV[0];
+
diff --git a/net-mgmt/cacti/files/patch-scripts__unix_users.pl b/net-mgmt/cacti/files/patch-scripts__unix_users.pl
new file mode 100644
index 000000000000..1e3e861ad394
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__unix_users.pl
@@ -0,0 +1,8 @@
+--- ./scripts/unix_users.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/unix_users.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ my $grep_string = $ARGV[0];
+
diff --git a/net-mgmt/cacti/files/patch-scripts__weatherbug.pl b/net-mgmt/cacti/files/patch-scripts__weatherbug.pl
new file mode 100644
index 000000000000..8ee812b24c8c
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__weatherbug.pl
@@ -0,0 +1,8 @@
+--- ./scripts/weatherbug.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/weatherbug.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ $output = `/bin/bash -c 'wget --quiet -O - \"http:\/\/wisapidata.weatherbug.com\/WxDataISAPI\/WxDataISAPI.dll?Magic=10991&RegNum=3647055&ZipCode=17241&StationID=NWVLL&Units=0&Version=2.7&Fore=1&t=1015084854\/"'`;
+
diff --git a/net-mgmt/cacti/files/patch-scripts__webhits.pl b/net-mgmt/cacti/files/patch-scripts__webhits.pl
new file mode 100644
index 000000000000..6b7e86e8c402
--- /dev/null
+++ b/net-mgmt/cacti/files/patch-scripts__webhits.pl
@@ -0,0 +1,8 @@
+--- ./scripts/webhits.pl.orig 2013-08-06 19:31:19.000000000 -0700
++++ ./scripts/webhits.pl 2014-08-11 18:37:08.000000000 -0700
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/local/bin/perl
+
+ if ($ARGV[0] eq "") {
+ $log_path = "/var/log/httpd/access_log";
diff --git a/net-mgmt/cacti/files/pkg-install.in b/net-mgmt/cacti/files/pkg-install.in
deleted file mode 100644
index d2a32d4fe7cb..000000000000
--- a/net-mgmt/cacti/files/pkg-install.in
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-PW=/usr/sbin/pw
-UID=107
-GID=${UID}
-CACTIUSER="%%CACTIUSER%%"
-CACTIGROUP="%%CACTIGROUP%%"
-CACTIDIR="%%CACTIDIR%%"
-PREFIX="%%PREFIX%%"
-
-case $2 in
-
-PRE-INSTALL)
-
- if ${PW} group show "${CACTIGROUP}" 2>/dev/null; then
- echo "You already have a group \"${CACTIGROUP}\", so I will use it."
- else
- if ${PW} groupadd ${CACTIGROUP} -g ${GID}; then
- echo "Added group \"${CACTIGROUP}\"."
- else
- echo "Adding group \"${CACTIGROUP}\" failed..."
- exit 1
- fi
- fi
-
- if ${PW} user show "${CACTIUSER}" 2>/dev/null; then
- echo "You already have a user \"${CACTIUSER}\", so I will use it."
- else
- if ${PW} useradd ${CACTIUSER} -u ${UID} -g ${CACTIGROUP} -h - \
- -d "/nonexistent" -s /sbin/nologin -c "Cacti Sandbox"
- then
- echo "Added user \"${CACTIUSER}\"."
- else
- echo "Adding user \"${CACTIUSER}\" failed..."
- exit 1
- fi
- fi
- ;;
-
-POST-INSTALL)
-
- chown -R ${CACTIUSER}:${CACTIGROUP} "${PREFIX}/${CACTIDIR}/rra/"
- [ -d "${PREFIX}/${CACTIDIR}/log/" ] || mkdir -p "${PREFIX}/${CACTIDIR}/log/"
- chown -R ${CACTIUSER}:${CACTIGROUP} "${PREFIX}/${CACTIDIR}/log/"
- chmod -R a+r "${PREFIX}/${CACTIDIR}/scripts/"
- ;;
-*)
- exit 1
-;;
-esac
-exit
diff --git a/net-mgmt/cacti/files/pkg-message.in b/net-mgmt/cacti/files/pkg-message.in
index bb07954a2f85..3c9270ce0882 100644
--- a/net-mgmt/cacti/files/pkg-message.in
+++ b/net-mgmt/cacti/files/pkg-message.in
@@ -2,22 +2,72 @@
Cacti is now installed. If you intall it for the first time,
you may have to follow this steps to make it work correctly:
-1. Create the MySQL database:
-# mysqladmin --user=root create cacti
-2. Create a mysql user/password for cacti:
- (change user and/or password if required)
-# echo "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser'; FLUSH PRIVILEGES;" | mysql
-3. Import the default cacti database:
-# mysql cacti < %%PREFIX%%/%%CACTIDIR%%/cacti.sql
-4. Edit %%PREFIX%%/%%CACTIDIR%%/include/config.php.
-5. Add the line to cron jobs with the command:
-# crontab -u %%CACTIUSER%% -e
+1. Create the MySQL database, a cacti user, and initialize:
+ a) CREATE DATABASE cacti;
+ b) Create a mysql user/password for cacti:
+ CREATE USER 'cacti'@'localhost' IDENTIFIED BY 'password';
+ FLUSH PRIVILEGES;
+ c) Add GRANTS:
+ GRANT ALL ON cacti.* TO 'cacti'@'localhost';
+ FLUSH PRIVILEGES;
+ d) Import the default cacti database:
+ mysql --database=cacti -ucacti -p < %%PREFIX%%/%%CACTIDIR%%/cacti.sql
+
+ NOTE:
+ * Cacti does not LOCK TABLES.
+
+2. Edit %%PREFIX%%/%%CACTIDIR%%/include/config.php from the template
+ config.php.orig.
+
+ PHP requires the time zone to be explicitly set rather that rely on
+ the system time zone, otherwise poller complains. I added the
+ following line to my config.php:
+
+ date_default_timezone_set('America/Los_Angeles');
+
+3. Add the following line to cron for %%CACTIUSER%%:
*/5 * * * * %%LOCALBASE%%/bin/php %%PREFIX%%/%%CACTIDIR%%/poller.php > /dev/null 2>&1
-6. Add alias in apache config for the cacti dir:
-Alias /cacti "%%PREFIX%%/%%CACTIDIR%%/"
-7. Be sure apache gives an access to the directory ('Allow from' keywords).
-8. Open a cacti login page in your web browser and login with admin/admin.
-If you update cacti, open a login page, an updating process
-will start automatically.
+4. Example Apache 2.4 configuration:
+
+ LoadModule php5_module libexec/apache22/libphp5.so
+
+ <FilesMatch "\.php$">
+ SetHandler application/x-httpd-php
+ </FilesMatch>
+ <FilesMatch "\.phps$">
+ SetHandler application/x-httpd-php-source
+ </FilesMatch>
+
+ DirectoryIndex index.php
+
+ DocumentRoot "/usr/local/share/cacti"
+
+ Alias /cacti "/usr/local/share/cacti/"
+ Alias /Cacti "/usr/local/share/cacti/"
+
+ <Directory "/usr/local/share/cacti">
+ Require all granted
+ AllowOverride None
+ Order Allow,deny
+ Allow from all
+ </Directory>
+
+5. Open a Cacti login page in your web browser and login with
+ admin/admin.
+
+If you update cacti, open a login page and an updating process will
+start automatically.
+
+NOTEs as of 10Aug2014:
+
+1) Cacti now better supports hier(7)
+
+ a) Cacti log files are now found under /var/log/cacti where you can
+ manage them using newsyslog.
+ b) Cacti RRD files are now found under /var/db/cacti/rra.
+
+2) The PERL paths in the Cacti PERL scripts have been updated to
+ /usr/local/bin.
+
=======================================================================
diff --git a/net-mgmt/cacti/pkg-plist b/net-mgmt/cacti/pkg-plist
index 2517a656016d..6ba19b4b14de 100644
--- a/net-mgmt/cacti/pkg-plist
+++ b/net-mgmt/cacti/pkg-plist
@@ -222,9 +222,7 @@
%%CACTIDIR%%/images/view_none.gif
%%CACTIDIR%%/include/auth.php
%%CACTIDIR%%/include/bottom_footer.php
-@unexec cmp -s %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php && rm -f %D/%%CACTIDIR%%/include/config.php || true
-%%CACTIDIR%%/include/config.php.orig
-@exec [ -f %D/%%CACTIDIR%%/include/config.php ] || cp %D/%%CACTIDIR%%/include/config.php.orig %D/%%CACTIDIR%%/include/config.php
+@sample %%CACTIDIR%%/include/config.php.sample
%%CACTIDIR%%/include/global_form.php
%%CACTIDIR%%/include/global.php
%%CACTIDIR%%/include/global_arrays.php
@@ -444,8 +442,6 @@
%%CACTIDIR%%/lib/utility.php
%%CACTIDIR%%/lib/variables.php
%%CACTIDIR%%/lib/xml.php
-%%CACTIDIR%%/log/.htaccess
-@unexec [ ! -s %%PREFIX%%/%%CACTIDIR%%/log/cacti.log ] && rm -f %%PREFIX%%/%%CACTIDIR%%/log/cacti.log
%%CACTIDIR%%/logout.php
%%CACTIDIR%%/plugins.php
%%CACTIDIR%%/poller.php
@@ -464,7 +460,6 @@
%%CACTIDIR%%/resource/snmp_queries/netware_cpu.xml
%%CACTIDIR%%/resource/snmp_queries/netware_disk.xml
%%CACTIDIR%%/rra.php
-%%CACTIDIR%%/rra/.htaccess
%%CACTIDIR%%/script_server.php
%%CACTIDIR%%/script_server.pl
%%CACTIDIR%%/scripts/3com_cable_modem.pl
@@ -494,13 +489,11 @@
%%CACTIDIR%%/user_admin.php
%%CACTIDIR%%/utilities.php
@dirrm %%CACTIDIR%%/scripts
-@dirrmtry %%CACTIDIR%%/rra
@dirrm %%CACTIDIR%%/resource/snmp_queries
@dirrm %%CACTIDIR%%/resource/script_server
@dirrm %%CACTIDIR%%/resource/script_queries
@dirrm %%CACTIDIR%%/resource
@dirrmtry %%CACTIDIR%%/plugins
-@dirrmtry %%CACTIDIR%%/log
@dirrm %%CACTIDIR%%/lib/adodb/lang
@dirrm %%CACTIDIR%%/lib/adodb/drivers
@dirrm %%CACTIDIR%%/lib/adodb/datadict
@@ -519,3 +512,14 @@
@dirrm %%CACTIDIR%%/docs
@dirrm %%CACTIDIR%%/cli
@dirrmtry %%CACTIDIR%%
+@comment
+@comment Manage the new Cacti dirs from their prior default location.
+@comment
+@owner %%CACTIUSER%%
+@group %%CACTIGROUP%%
+@dirrmtry /var/log/cacti
+@dirrmtry /var/db/cacti/rra
+@dirrmtry /var/db/cacti/scripts
+@dirrmtry /var/db/cacti
+@group wheel
+@owner root