Date: Fri, 15 Aug 2014 10:43:41 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r364957 - in head/net-mgmt/cacti: . files Message-ID: <201408151043.s7FAhfv6086083@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Fri Aug 15 10:43:41 2014 New Revision: 364957 URL: http://svnweb.freebsd.org/changeset/ports/364957 QAT: https://qat.redports.org/buildarchive/r364957/ Log: net-mgmt/cacti: add stage support PR: 192618 Submitted by: Dennis Glatting <freebsd@pki2.com> Added: head/net-mgmt/cacti/files/patch-include__global.php (contents, props changed) head/net-mgmt/cacti/files/patch-include__global_settings.php (contents, props changed) head/net-mgmt/cacti/files/patch-install__index.php (contents, props changed) head/net-mgmt/cacti/files/patch-lib__rrd.php (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__diskfree.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__linux_memory.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__loadavg.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__ping.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__unix_processes.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__unix_users.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__weatherbug.pl (contents, props changed) head/net-mgmt/cacti/files/patch-scripts__webhits.pl (contents, props changed) Deleted: head/net-mgmt/cacti/files/patch-lib-rrd.php head/net-mgmt/cacti/files/patch-scripts-diskfree.pl head/net-mgmt/cacti/files/patch-scripts-ping.pl head/net-mgmt/cacti/files/pkg-install.in Modified: head/net-mgmt/cacti/Makefile head/net-mgmt/cacti/distinfo head/net-mgmt/cacti/files/pkg-message.in head/net-mgmt/cacti/pkg-plist Modified: head/net-mgmt/cacti/Makefile ============================================================================== --- head/net-mgmt/cacti/Makefile Fri Aug 15 10:11:10 2014 (r364956) +++ head/net-mgmt/cacti/Makefile Fri Aug 15 10:43:41 2014 (r364957) @@ -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 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> Modified: head/net-mgmt/cacti/distinfo ============================================================================== --- head/net-mgmt/cacti/distinfo Fri Aug 15 10:11:10 2014 (r364956) +++ head/net-mgmt/cacti/distinfo Fri Aug 15 10:43:41 2014 (r364957) @@ -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 Added: head/net-mgmt/cacti/files/patch-include__global.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-include__global.php Fri Aug 15 10:43:41 2014 (r364957) @@ -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"; Added: head/net-mgmt/cacti/files/patch-include__global_settings.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-include__global_settings.php Fri Aug 15 10:43:41 2014 (r364957) @@ -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( Added: head/net-mgmt/cacti/files/patch-install__index.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-install__index.php Fri Aug 15 10:43:41 2014 (r364957) @@ -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 */ Added: head/net-mgmt/cacti/files/patch-lib__rrd.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-lib__rrd.php Fri Aug 15 10:43:41 2014 (r364957) @@ -0,0 +1,35 @@ +--- ./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; + + if ($graph_item_types{$graph_item["graph_type_id"]} == "COMMENT") { ++ # perform variable substitution first (in case this will yield an empty results or brings command injection problems) ++ $comment_arg = rrd_substitute_host_query_data($graph_variables["text_format"][$graph_item_id], $graph, $graph_item); ++ # next, compute the argument of the COMMENT statement and perform injection counter measures ++ if (trim($comment_arg) == '') { # an empty COMMENT must be treated with care ++ $comment_arg = cacti_escapeshellarg(' ' . $hardreturn[$graph_item_id]); ++ } else { ++ $comment_arg = cacti_escapeshellarg($comment_arg . $hardreturn[$graph_item_id]); ++ } ++ ++ # create rrdtool specific command line + if (read_config_option("rrdtool_version") != "rrd-1.0.x") { +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id])) . " "; +- if (trim($comment_string) == 'COMMENT:"\n"') { +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work +- } else if (trim($comment_string) != "COMMENT:\"\"") { +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item); +- } ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . str_replace(":", "\:", $comment_arg) . " "; + }else { +- $comment_string = $graph_item_types{$graph_item["graph_type_id"]} . ":" . cacti_escapeshellarg($graph_variables["text_format"][$graph_item_id] . $hardreturn[$graph_item_id]) . " "; +- if (trim($comment_string) == 'COMMENT:"\n"') { +- $txt_graph_items .= 'COMMENT:" \n"'; # rrdtool will skip a COMMENT that holds a NL only; so add a blank to make NL work +- } else if (trim($comment_string) != "COMMENT:\"\"") { +- $txt_graph_items .= rrd_substitute_host_query_data($comment_string, $graph, $graph_item); +- } ++ $txt_graph_items .= $graph_item_types{$graph_item["graph_type_id"]} . ":" . $comment_arg . " "; + } + }elseif (($graph_item_types{$graph_item["graph_type_id"]} == "GPRINT") && (!isset($graph_data_array["graph_nolegend"]))) { + $graph_variables["text_format"][$graph_item_id] = str_replace(":", "\:", $graph_variables["text_format"][$graph_item_id]); /* escape colons */ Added: head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__3com_cable_modem.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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>; Added: head/net-mgmt/cacti/files/patch-scripts__diskfree.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__diskfree.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -0,0 +1,10 @@ +--- ./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 +-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])%(.* )/) { + print "megabytes:$7 percent:$9"; Added: head/net-mgmt/cacti/files/patch-scripts__linux_memory.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__linux_memory.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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>) { Added: head/net-mgmt/cacti/files/patch-scripts__loadavg.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__loadavg.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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 |"); Added: head/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__loadavg_multi.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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 |"); Added: head/net-mgmt/cacti/files/patch-scripts__ping.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__ping.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -0,0 +1,17 @@ +--- ./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" + # newer use "icmp_req" instead +-open(PROCESS, "ping -c 1 $host | grep 'icmp_[s|r]eq' | grep time |"); ++open(PROCESS, "/sbin/ping -c 1 $host | grep 'icmp_[s|r]eq' | grep time |"); + $ping = <PROCESS>; + close(PROCESS); + $ping =~ m/(.*time=)(.*) (ms|usec)/; Added: head/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__query_unix_partitions.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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"; Added: head/net-mgmt/cacti/files/patch-scripts__unix_processes.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__unix_processes.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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>; Added: head/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__unix_tcp_connections.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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]; + Added: head/net-mgmt/cacti/files/patch-scripts__unix_users.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__unix_users.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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]; + Added: head/net-mgmt/cacti/files/patch-scripts__weatherbug.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__weatherbug.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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\/"'`; + Added: head/net-mgmt/cacti/files/patch-scripts__webhits.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net-mgmt/cacti/files/patch-scripts__webhits.pl Fri Aug 15 10:43:41 2014 (r364957) @@ -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"; Modified: head/net-mgmt/cacti/files/pkg-message.in ============================================================================== --- head/net-mgmt/cacti/files/pkg-message.in Fri Aug 15 10:11:10 2014 (r364956) +++ head/net-mgmt/cacti/files/pkg-message.in Fri Aug 15 10:43:41 2014 (r364957) @@ -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. + ======================================================================= Modified: head/net-mgmt/cacti/pkg-plist ============================================================================== --- head/net-mgmt/cacti/pkg-plist Fri Aug 15 10:11:10 2014 (r364956) +++ head/net-mgmt/cacti/pkg-plist Fri Aug 15 10:43:41 2014 (r364957) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408151043.s7FAhfv6086083>