[34453] trunk/dports/net/cacti

markd at macports.org markd at macports.org
Mon Feb 25 10:46:03 PST 2008


Revision: 34453
          http://trac.macosforge.org/projects/macports/changeset/34453
Author:   markd at macports.org
Date:     2008-02-25 10:46:00 -0800 (Mon, 25 Feb 2008)

Log Message:
-----------
Corrections for the plugins variant.

Modified Paths:
--------------
    trunk/dports/net/cacti/Portfile

Added Paths:
-----------
    trunk/dports/net/cacti/files/patch-plugins.php.diff

Modified: trunk/dports/net/cacti/Portfile
===================================================================
--- trunk/dports/net/cacti/Portfile	2008-02-25 18:01:06 UTC (rev 34452)
+++ trunk/dports/net/cacti/Portfile	2008-02-25 18:46:00 UTC (rev 34453)
@@ -4,6 +4,7 @@
 
 name			cacti
 version			0.8.7b
+revision		1
 categories		net
 maintainers		markd
 platforms		darwin
@@ -40,23 +41,24 @@
 }
 
 destroot {
+	file mkdir ${destroot}${cactidir}
+
 	if { [variant_isset plugins] } {
 		reinplace "s|+++ 0.8.7|+++ cacti-${version}|g" \
 			${workpath}/cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.0.diff
-
 	system "cd ${worksrcpath} && patch -p1 -N < ${workpath}/cacti-plugin-arch/cacti-plugin-0.8.7b-PA-v2.0.diff"
-
 	file copy ${workpath}/cacti-plugin-arch/pa.sql \
 		${destroot}${cactidir}
+# Temporary patch for error in PA patch file
+	system "cd ${worksrcpath} && patch -p0 < ${filespath}/patch-plugins.php.diff"
 	}
 
-	xinstall -m 755 -d ${destroot}${cactidir}
 	system "cp -R ${worksrcpath}/* ${destroot}${cactidir}"
 }
 
 post-activate {
 
-ui_msg "\n **** To complete the Cacti OS X installation ****
+ui_msg "\n **** To complete the Cacti installation ****
 
 To complete the Cacti installation follow the steps below.  Read the documentation
 at http://www.cacti.net/documentation.php for operational instructions.
@@ -75,9 +77,11 @@
 
    If not, locate the php.ini file for your version of PHP and type the path there.
 
+
 2) Set Cacti permissions.
    sudo chown -R <cacti-user>:<cacti-group> ${prefix}/share/${name}/
 
+
 3) Setup MySQL and prepare it for Cacti.
    Configure MySQL (new MySQL installs)
 	sudo -u mysql ${prefix}/lib/mysql5/bin/mysql_install_db
@@ -102,15 +106,13 @@
    Import the cacti database.
 	sudo cat ${cactidir}/cacti.sql | mysql5 -u root -p cacti (cacti is the db name)
 
-   If you used the 'plugins' variant for Cacti Plugin Architecture support, add the PA schema:
-	sudo cat ${cactidir}/pa.sql | mysql5 -u root -p cacti
-
    Verify the Cacti Database.
 	mysql5 -u root -p
 	mysql> use cacti;
 	mysql> show tables;
 	mysql> exit;
 
+
 4) Edit ${cactidir}/include/config.php to match your MySQL information.
 
 	\$database_type = \"mysql\";
@@ -119,16 +121,39 @@
 	\$database_username = \"cacti\";
 	\$database_password = \"<my-cacti-password>\";
 
+
 5) Place a symlink for Cacti inside your Apache document root.
 
 	ln -s ${cactidir}  <Apache-docroot>/cacti
 
+
 6) Edit the Cacti user's crontab file.
 	sudo -u <cactiuser> crontab -e
 
   Insert the crontab entry below:
 	*/5 * * * * ${prefix}/bin/php ${cactidir}/poller.php > /dev/null 2>&1
 
+
+8) If you installed Cacti with the 'plugins' variant for Cacti Plugin Architecture support,
+   you must perform these additional steps.
+
+   a) Import the PA schema.
+	cd ${cactidir}
+	sudo cat ${cactidir}/pa.sql | mysql5 -u root -p cacti (cacti is the db name)
+
+   b) Download the particular Cacti plugin(s) you want and copy their folders to ${cactidir}/plugins/<plugin-dir>/.
+      For example:
+	${cactidir}/plugins/weathermap/
+
+   c) Edit ${cactidir}/include/global.php and add an entry for each plugin you installed after the'plugins' statement,
+      as shown in this example using the weathermap plugin:
+	\$plugins = array();
+	\$plugins[] = 'weathermap';
+
+   d) Enable the plugin in the Cacti web interface; this creates a top-level tab for the plugin in the Cacti interface
+	Console -> User Management  (select a Cacti user and check the 'View Weathermaps' checkboxes)
+
+
 7) Go to http://localhost/cacti/install/index.php.
 	The default user/password is admin/admin.  Select 'New Install', enter
 	the paths for SNMP / RRDtool / PHP (see below), and click 'Finish'.
@@ -141,7 +166,9 @@
 	RRDtool binary path: ${prefix}/bin/rrdtool
 	PHP binary path: ${prefix}/bin/php (if not using MacPorts PHP, use appropriate path)
 
+NOTE: After you login to Cacti, immediately click 'Settings' and set the RRDtool version to 1.2.x.
 
+
 \n"
 
 }

Added: trunk/dports/net/cacti/files/patch-plugins.php.diff
===================================================================
--- trunk/dports/net/cacti/files/patch-plugins.php.diff	                        (rev 0)
+++ trunk/dports/net/cacti/files/patch-plugins.php.diff	2008-02-25 18:46:00 UTC (rev 34453)
@@ -0,0 +1,17 @@
+--- include/plugins.php.org	2008-02-25 09:47:35.000000000 -0800
++++ include/plugins.php	2008-02-25 09:48:12.000000000 -0800
+@@ -32,13 +32,7 @@
+     }
+ }
+ 
+-if (isset($_SERVER['DOCUMENT_ROOT']) && isset($_SERVER['REMOTE_ADDR'])) {
+-	$config['url_path'] = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']), strlen(__FILE__) - strlen($_SERVER['DOCUMENT_ROOT']) - strlen('include/plugins.php'));
+-	db_execute("REPLACE INTO settings (name, value) VALUES ('url_path', '" . $config['url_path'] . "')");
+-} else {
+-	$config['url_path'] = db_fetch_cell("SELECT value FROM settings WHERE name = 'url_path'");
+-}
+-
++$config['url_path'] = '/cacti/';
+ define('URL_PATH', $config['url_path']);
+ 
+ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080225/67804a21/attachment-0001.html 


More information about the macports-changes mailing list