Cacti

From the official Cacti Web-site: "Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices."

Installing

 * Before installing Cacti check for net-snmp package.

Cacti/SNMP host setup

You will probably need the following USE flags set:

USE="mysql xml sockets vhosts"

For php to work correctly

You will probably need the following USE flags set:

USE="apache2 snmp vhosts"

To install Cacti run the following command:

emerge cacti

If you already installed php, but without xml flag set, you should re-emerge php with USE="xml" first of all! The same applies for the sockets flag.

After emerging, you need to install an cacti instance somewhere:

webapp-config -I -h localhost -d cacti cacti 

Config
After installation you will need to edit the config file and insert the proper data to fit your installation

File: include/config.php $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactipass"; $database_port = "3306";

Install the database
First you need to create a database named 'cacti' with a user named cactiuser

mysql -u root -p mysql> create database cacti; mysql> grant all on cacti.* to cactiuser@localhost; mysql> set password for cactiuser@localhost=password('cactipass'); mysql> exit

While in the cacti folder run this command to insert the default database

mysql -u cactiuser -p cacti < cacti.sql

Finishing
Finish the configuration by accessing Cacti:

http://url/to/cacti/

Configure the required file paths. If you're going to login for the first time, the password-username pair is admin-admin by default.

Set the permissions on the cacti directories to be able to generate the graph/log. Execute this command in the cacti folder.

chown -R apache:apache rra/ log/

Crontab
as your cacti user add the following to the cron file

*/5 * * * * apache php /cacti/poller.php > /dev/null 2>&1

Troubleshooting
If no graphs are generated and you receieve the following message in your cron logs, this indicates that an entry can not be found for the apache user in /etc/shadow.

su: Authentication service cannot retrieve authentication info.

This can be fixed by adding it with the following command:

pwconv