Cacti version 0.8.7e - How to Download and Install on Mac OS X
Friday the 19th of March, 2010

    version 0.8.7e

      View the most recent changes for the cacti port at: cacti.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for cacti.
      The raw portfile for cacti 0.8.7e is located here:
      http://cacti.darwinports.com/dports/net/cacti/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/cacti


      The cacti Portfile 58230 2009-09-24 16:45:22Z ryandesign macports.org $

      PortSystem 1.0

      Name: cacti
      Version: 0.8.7e
      Category: net
      Maintainers: markd
      Platform: darwin

      Description: Cacti is a complete RRDtool network graphing solution.

      Long Description: Cacti is a complete network graphing solution designed to harness the power of RRDtool's data storage and graphing functions.

      Homepage: http://www.cacti.net
      Master Sites: http://www.cacti.net/downloads/:cacti
      use_zip yes

      distfiles ${distname}${extract.suffix}:cacti
      Checksums: ${distname}${extract.suffix} md5 b5eb2f5c512959417d51535f37d4e97c

      depends_lib path:bin/mysql_config5:mysql5 port:rrdtool

      use_configure no
      build {}

      set cactiversion 0.8.7e
      set pluginversion 2.5
      set cactidir ${prefix}/share/cacti

      Variant: server description {does nothing in this port, but its presence triggers mysql5 server variant} {}
      Variant:_set server

      Variant: plugins description {The Plugin Architecture for Cacti} {
      master_sites-append http://mirror.cactiusers.org/downloads/plugins:plugins
      distfiles-append cacti-plugin-${cactiversion}-PA-v${pluginversion}${extract.suffix}:plugins
      checksums-append cacti-plugin-${version}-PA-v${pluginversion}${extract.suffix} md5 e171374af8c5267b9fb0d144ac817f86
      }

      destroot {
      # Copy Cacti files
      file mkdir ${destroot}${cactidir}
      system "cp -R ${worksrcpath}/* ${destroot}${cactidir}"

      # Copy PA architecture files
      if { [variant_isset plugins] } {
      # system "cd ${worksrcpath} && patch -p1 -N -F 3 < ${workpath}/cacti-plugin-${version}-PA-v${pluginversion}.diff"
      system "cp -R ${workpath}/files-${version}/* ${destroot}${cactidir}"
      }
      }

      post-activate {

      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.


      1) Install PHP and MySQL 5 (not covered). These instructions assume MySQL 5 was
      installed from MacPorts.

      Check to make sure the PHP variable \"mysql.default_socket\" is set to path
      ${prefix}/var/run/mysql5/mysqld.sock by viewing the output of this terminal command:
      php -i

      If not, locate the php.ini file for your version of PHP and type the path there.


      2) Set Cacti permissions.
      sudo chown -R : ${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

      Start MySQL:
      sudo ${prefix}/share/mysql5/mysql/mysql.server start

      Set MySQL to start at system boot (optional)
      sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

      Set a root MySQL password.
      Follow the instructions that were given after you executed 'mysql_install_db' above.

      Create a cacti MySQL user and cacti database.
      mysql5 -u root -p (login with new root password when prompted)
      mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on cacti.* to cacti localhost;
      mysql> grant CREATE,INSERT,SELECT,DELETE,UPDATE on cacti.* to cacti;
      mysql> SET PASSWORD FOR cacti localhost = OLD_PASSWORD('');
      mysql> create database cacti;
      mysql> exit;

      Import the cacti database.
      sudo cat ${cactidir}/cacti.sql | mysql5 -u root -p cacti (cacti is the db name)

      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\";
      \$database_default = \"cacti\";
      \$database_hostname = \"localhost\";
      \$database_username = \"cacti\";
      \$database_password = \"\";


      5) Place a symlink for Cacti inside your Apache document root.

      ln -s ${cactidir} /cacti


      6) Edit the Cacti user's crontab file.
      sudo -u 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//.
      For example:
      ${cactidir}/plugins/weathermap/

      c) Edit ${cactidir}/include/global.php - modify the url_path to reflect Cacti's default URL
      and add an entry to load each plugin you install; the weathermap plugin is an example:

      \$config\['url_path'\] = '/cacti/';

      \$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'.
      You may now use Cacti at http://localhost/cacti/index.php.

      Paths:
      snmpwalk binary path: /usr/bin/snmpwalk
      snmpget binary path: /usr/bin/snmpget

      RRDtool binary path: ${prefix}/bin/rrdtool
      PHP binary path: ${prefix}/bin/php (if not using MacPorts PHP, use appropriate path)

      \n"

      }

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/cacti
      % sudo port install cacti
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching cacti
      ---> Verifying checksum for cacti
      ---> Extracting cacti
      ---> Configuring cacti
      ---> Building cacti with target all
      ---> Staging cacti into destroot
      ---> Installing cacti
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using cacti with these commands:
      %  man cacti
      % apropos cacti
      % which cacti
      % locate cacti

     Where to find more information:

    Darwin Ports



    Lightbox this page.