Cacti Monitoring Tool

The CSCF cacti install is located on watcher.cscf and is accessible via cacti.cscf.

Cacti Monitoring



  • Configure watcher.cscf to listen on cacti.cscf's IP:
  • Edit /etc/network/interfaces and add the following lines to the end:
          # cacti.cscf
          auto eth0:1
          iface eth0:1 inet static
    • The eth0:1 interface represents an alias for eth0. You should make sure that eth0:1 is unique; you can use eth0:2, eth0:3, etc... if you need multiple aliases.
    • ifup eth0:1

  • Install Apache and add the cacti vhost:
    • sudo apt-get install apache2 libapache2-mod-php5
    • Edit (as root) /etc/apache2/sites-available/cacti and add the following lines:
              <VirtualHost cacti.cscf>
                  ServerAlias cacti cacti.cscf
                  DocumentRoot /usr/share/cacti/site
                  # redirect to fqdn
                  RewriteEngine On
                  RewriteCond %{HTTP_HOST} ^cacti$|^cacti\.cscf$ [NC]
                  RewriteRule ^(.*)$$1 [R=301,L]
    • Enable mod_rewrite: sudo a2enmod rewrite
    • Enable the cacti vhost: sudo a2ensite cacti

  • Install cacti (and dependencies)
    • sudo apt-get install mysql-server cacti
    • Restart apache: sudo invoke-rc.d apache2 restart
    • Go to http://cacti.cscf/ and configure cacti (defaults should be fine)
    • We need cacti 0.8.7 but Gutsy Gibbon only includes 0.8.6. To install 0.8.7:

Performance Tuning

  • First you'll want to add some additional indexes by executing the following mysql statements (after selecting the cacti db) (e.g. in phpmyadmin):
    • ALTER TABLE `data_input_data` ADD INDEX ( value(8) )
    • ALTER TABLE `data_input_data` ADD INDEX ( t_value )
    • ALTER TABLE `graph_templates_item` ADD INDEX ( task_item_id )
    • ALTER TABLE `data_template_data` ADD INDEX ( data_input_id )
    • ALTER TABLE `data_local` ADD INDEX ( data_template_id )
    • ALTER TABLE `data_local` ADD INDEX ( host_id )

  • I also compiled and installed spine, the cacti c-based poller, as the php-based one was very slow:
    • Download cacti-spine-0.8.7.tar.gz from
    • tar -xf cacti-spine-0.8.7.tar.gz; cd cacti-spine-0.8.7
    • aclocal; libtoolize --force; autoconf; autoheader; automake; ./configure
    • make
    • sudo make install
    • sudo cp spine.conf /etc/
    • sudo chmod o-r /etc/spine.conf
    • sudo nano /etc/spine.conf
      • Edit the login details, which you can find in /etc/cacti/debian.php
    • Goto Cacti Settings -> Paths and change the spine path to /usr/local/sbin/spine
    • Goto Cacti Settings -> Poller and change the poller type to spine


You must run add_device_and_graphs.php as root (e.g. 'sudo add_device_and_graphs.php ...') on watcher.cscf.



    add_device_and_graphs.php [options] template hostname [tree]

    Adds hostname to cacti and creates all relevant graphs indicated by
    template. Note that template may a partial string, as long as the string
    matches unambiguously to a single host template. If tree is specified,
    then the host is inserted into the graph tree. Header may be a path of
    partial strings, separated by forward-slashes (e.g. linux/cpu).

        name of device; defaults to hostname

        the public/read community; default UofW

        the snmp version; default 2

        the snmp port; default 161

        list of interfaces to graph; prompt for interfaces by default

        graph all interfaces

        use 32-bit counters (defaults to 64-bit counters); this is needed for
        Solaris hosts, NetApps, and UPSes

        list of disks to graph disk i/o for; prompt for disks by default

    [The following are planned features; they are currently incomplete]

        list of temperature sensors to graph; prompt for sensors by default

        list of fan sensors to graph; prompt for sensors by default

        list of disks to graph temperatures for; prompt for disks by default

    Written by David Bartley (dtbartle).



    delete_device_and_graphs.php hostname

    Deletes hostname and associated graphs from cacti.

    Written by David Bartley (dtbartle).



    add_combined_graphs.php [options] title
    data-template[*snmp-field*snmp-value][^data-source-name] tree
    [source-trees ...]

    Adds a combined graph. The data-template argument indicates the type of
    data to graph (e.g. Logged in Users) and may be a partial string. The
    graph will be created at the specified tree. The source-tree arguments
    indicate which trees or hosts to include in the graph. If source-tree is
    a tree all children hosts will be added.

        a comma-separated list of functions to include; possible functions
        are max, min, avg, and cur

        graph width

        graph height

        whether to replace graphs with the same title; the default is to
        prompt when a graph with the same title is found

    Written by David Bartley (dtbartle).

Network Weathermap

Weathermap is an application that uses RRD files to make graphs of network flow. It has the ability to plugin to cacti:

tar xf
cp -a weathermap /usr/share/cacti/plugins/
cd /usr/share/cacti/site/plugins/weathermap
mkdir /var/lib/weathermap
mv configs /var/lib/weathermap
mv output /var/lib/weathermap
chown www-data:www-data /var/lib/weathermap/*:w
ln -s /var/lib/weathermap/configs configs
ln -s /var/lib/weathermap/output output
vim ../../include/global.php
  After $plugins = array(); add:
    $plugins[] = 'weathermap';

User permissions must now be configured. To this goto You will need to go into each user, and set the relevant realm permissions. You should now have a Weathermaps entry on the menu and Weathermap tab.

-- DavidBartley

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r7 - 2009-01-26 - LawrenceFolland
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback