Cacti is a complete frontend to RRDTool, it stores all of the
necessary information to create graphs and populate them with data in
a MySQL database. The frontend is completely PHP driven. Along with
being able to maintain Graphs, Data Sources, and Round Robin Archives
in a database, cacti handles the data gathering. There is also SNMP
support for those used to creating traffic graphs with MRTG.

You are advised to check and go through the Cacti Online
Documentation for a
comprehensive explaination of Cacti and the features it provides.

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
#
<VirtualHost *:80>
ServerAdmin admin@example.org
ServerName monitor.example.org
ServerAlias monitor.example.org
DocumentRoot "/usr/local/share/cacti"
<Directory "/usr/local/share/cacti">
AllowOverride None
Order Allow,Deny
Allow from all
</Directory>
ErrorLog "/var/log/apache/httpd-monitor.example.org-error.log"
CustomLog "/var/log/apache/httpd-monitor.example.org-access.log" common
<VirtualHost>

The next thing to do is to add a cron job that polls your machines and
routers each 5 minutes.

Now, let’s start Apache and start using Cacti. First we test the
configuration for errors, and then we start Apache.

$ sudo apachectl configtest
Syntax OK

Configuration is OK, so now we can start Apache:

$ sudo apachectl start

Now, please continue reading through the next chapter in order to do
the initial setup of Cacti and start using it.

Using Cacti

Before we can start using and monitoring devices via Cacti we first
need to do the initial setup for Cacti.

To do that, open a browser and open the Cacti web interface, which
should be on the http://monitor.example.org/ Apache vhost we’ve
installed and configured.

Please follow the steps provided by the Cacti installer, so that you
can do the initial configuration of Cacti.

When you are invited to login, use admin for the username and
password - right after that you will be advised to change the default
password to one of your choice.

Now you can start adding the machines and routers you want to be
monitored by Cacti.

To do that just go to Console -> Devices -> Add and enter the needed
information of the machine to be monitored.

Again, I would recommend that you now go and read the great Cacti
online documentation, for
more comprehensive explanation of how to use and configure the
different aspects of Cacti.

Installing Cacti Spine

This step is optional. It just covers how to install and configure
Cacti Spine - a fast poller for
Cacti.

Spine is another SNMP poller that can be used by Cacti. It’s a good
replacement for the default cmd.php poller that comes with Cacti and
is quite fast.

If your environment constist of a lot of machines you might want to
prefer using Cacti Spine just for that reason - performance.

To install Cacti Spine, we are going to use again the FreeBSD Ports
Collection.

$ sudo cd /usr/ports/net-mgmt/cacti-spine && make install clean

Once the installation of net-mgmt/cacti-spine is over, you should see
something similar:

===> Installing for spine-0.8.7.g_1
===> Generating temporary packing list
===> Checking if net-mgmt/cacti-spine already installed
===> Registering installation for spine-0.8.7.g_1
===> SECURITY REPORT:
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/bin/spine
If there are vulnerabilities in these programs there may be a security
risk to the system. FreeBSD makes no guarantee about the security of
ports included in the Ports Collection. Please type'make deinstall'
to deinstall the port if this is a concern.
For more information, and contact details about the security
status of this software, see the following webpage:
http://www.cacti.net/cactid_info.php
===> Cleaning for spine-0.8.7.g_1