source: trunk/dports/net/cacti/Portfile

Last change on this file was 125738, checked in by mf2k@…, 3 years ago

adodb argus-monitor base blt cacti cdpr doclifter eventlog expect gkrellm honeyd iwidgets kchmviewer libdnsres monarch moodss moomps nagios nagios-plugins nedi netmrg network-weathermap nfdump nfsen nrg nrpe nsca ntop p5-archive-zip p5-cgi p5-cgi-speedycgi p5-convert-asn1 p5-libintl-perl p5-mhonarc p5-net p5-perl-ldap rancid rrdtool scotty sendpage smokeping snort sympa syslog-ng tclx tftp-hpa tktable uplog vm-pop3d xserve-raid-tools zabbix: Ports abandoned by markd. (#44782)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1# $Id: Portfile 125738 2014-09-25 14:43:03Z ryandesign@macports.org $
2
3PortSystem      1.0
4
5name                    cacti
6version                 0.8.8b
7categories              net
8license                 GPL-2+
9maintainers             nomaintainer
10platforms               darwin
11supported_archs noarch
12
13description             Cacti is a complete RRDtool network graphing solution.
14
15long_description        Cacti is a complete network graphing solution designed \
16                        to harness the power of RRDtool's data storage and \
17                        graphing functions.
18
19homepage                http://www.cacti.net
20master_sites            http://www.cacti.net/downloads
21
22checksums               md5 acb40deae073ca22e5c01a8e3ba389fb \
23                        rmd160 a2c88961565c6b5d593b4f2603514139800c9145
24
25depends_lib             path:bin/mysql_config5:mysql5 \
26                        port:rrdtool
27
28use_configure   no
29build {}
30
31set cactiversion 0.8.8a
32set cactidir ${prefix}/share/cacti
33
34destroot {
35# Copy Cacti files
36        file mkdir ${destroot}${cactidir}
37        system "cp -R ${worksrcpath}/* ${destroot}${cactidir}"
38}
39
40
41notes "
42**** To complete the Cacti installation ****
43
44The full documentation may be found at http://www.cacti.net/documentation.php.
45
46
471) Install PHP and MySQL 5 (not covered).  These instructions assume MySQL 5 was
48   installed from MacPorts.
49
50   Check to make sure the PHP variable \"mysql.default_socket\" is set to path
51   ${prefix}/var/run/mysql5/mysqld.sock by viewing the output of this terminal command:
52        php -i
53
54   If not, locate the php.ini file for your version of PHP and type the path there.
55
56
572) Set Cacti permissions.
58   sudo chown -R <cacti-user>:<cacti-group> ${prefix}/share/${name}/
59
60
613) Setup MySQL and prepare it for Cacti.
62   Configure MySQL (new MySQL installs)
63        sudo -u mysql ${prefix}/lib/mysql5/bin/mysql_install_db
64
65  Start MySQL:
66        sudo ${prefix}/share/mysql5/mysql/mysql.server start
67
68   Set MySQL to start at system boot
69        sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
70
71   Set a root MySQL password.
72        Follow the instructions that were given after you executed 'mysql_install_db' above.
73
74   Create a cacti MySQL user and cacti database.
75        mysql5 -u root -p (login with root password set above when prompted)
76        mysql> GRANT ALL ON cacti.* to cacti@localhost;
77        mysql> SET PASSWORD FOR cacti@localhost = PASSWORD('<my-cactidb-pwd>');
78        mysql> flush privileges;
79        mysql> create database cacti;
80        mysql> exit;
81
82   Import the cacti database.
83        sudo cat ${cactidir}/cacti.sql | mysql5 -u root -p cacti (cacti is the db name)
84
85   Verify the Cacti Database.
86        mysql5 -u root -p
87        mysql> use cacti;
88        mysql> show tables;
89        mysql> exit;
90
91
924) Edit ${cactidir}/include/config.php to match your MySQL information and url path.
93
94        \$database_type = \"mysql\";
95        \$database_default = \"cacti\";
96        \$database_hostname = \"localhost\";
97        \$database_username = \"cacti\";
98        \$database_password = \"<my-cactidb-pwd>\";
99
100
1015) Place a symlink for Cacti inside your Apache document root.
102
103        ln -s ${cactidir}  <Apache-docroot>/cacti
104
105
1066) Edit the Cacti user's crontab file.
107        sudo -u <cactiuser> crontab -e
108
109  Insert the crontab entry below:
110        */5 * * * * ${prefix}/bin/php ${cactidir}/poller.php > /dev/null 2>&1
111
112
1137) If you wish to use Cacti plugins, you must perform these additional steps.
114
115   a) Download the Cacti plugin(s) you want to use and copy the unzipped directory to ${cactidir}/plugins/
116      For example:
117        ${cactidir}/plugins/weathermap/
118
119   b) In the Cacti web GUI, go to Configuration -> Plugin Management and you should see your plugin(s) listed.
120      Under 'Actions', click the the install icon to install each plugin.
121
122   c) Ensure that your Cacti user has permissions to manage the plugins
123      User Management - select a Cacti user and set Configure/Manage or View options as desired
124
125
1268) Go to http://localhost/cacti/install/index.php.
127        The default user/password is admin/admin.  Select 'New Install', enter
128        the paths for SNMP / RRDtool / PHP (see below), and click 'Finish'.
129        You may now use Cacti at http://localhost/cacti/index.php.
130
131Verify paths:
132        snmpwalk binary path: /usr/bin/snmpwalk
133        snmpget binary path: /usr/bin/snmpget
134
135        RRDtool binary path: ${prefix}/bin/rrdtool
136        PHP binary path: ${prefix}/bin/php (if not using MacPorts PHP, use appropriate path)
137
138
1399) Create interface traffic graphs
140   a) Devices -> Add
141        -Fill out form for the switch or router
142        -Make sure to include the SNMP community string of the device
143        -Click the 'Create' button to add device
144
145   b) In the devices pane, click on the newly added device to open the edit pane
146        -Click 'Create Graphs for this Host' link
147        -An SNMP query is made and interfaces listed; check the interface(s) to be graphed
148        -Select a graph type from the menu in the bottom right and click the 'Create' button beside it
149
150   c) Place some or all a device's graphs on a graph tree from the Devices or Graph Management section
151"
Note: See TracBrowser for help on using the repository browser.