Cacti On An ISPConfig Server Within 10 Easy Steps

Want to support HowtoForge? Become a subscriber!
 
Submitted by VMartins (Contact Author) (Forums) on Mon, 2006-11-20 02:39. :: ISPConfig | Control Panels | Monitoring

Cacti On An ISPConfig Server Within 10 Easy Steps

Cacti Logo

Version: 1.1
Author: Vinicius Martins <vinicius [at] viniciusmartins [dot] eng [dot] br >
Last edited 11/16/2006

In this article I describe how to install and setup the Cacti in a ISPConfig Server. There aren't many differences from installing in other ISP Managers or standalone Apache installations. I tried many others solutions, but Cacti is very simple and fast to implement.

In Cacti website we find: "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."

I use a Ubuntu Edgy Eft (6.10), and followed the The Perfect Setup - Ubuntu 6.10 Server (Edgy Eft).

I will use as an example:
-          Domain Name: monitor.domain.br
-          MySQL Database Name: web1_db1
-          MySQL Username: web1_u1
-          MySQL User Password: mysqlpassword
-          Website Sytem Folder: /var/www/web1/web/
-          Cacti Version: 0.8.6i

Step 1 - Create a website and a database:

In ISPConfig, create a website via “New site” in the main menu.

On the tab called “Basis” use monitor for the hostname and domain.br for the domain name. Enable MySQL and PHP scripts for this website but disable PHP Safe Mode.

Go to your new website, in tab "Options", In Database click in the New button to create a database web1_db1 and user web1_u1.

Step 2 - Install Cacti dependencies:

To install Cacti, the easy and fast way is use apt-get. Using user with administrative permissions, run in the shell:

sudo apt-get install cacti

The Cacti is installed now, but not the last version. In Ubuntu/Debian respository have the 0.8.6c version, and in the Cacti website has newer version, 0.8.6i.

Now, I will remove only the older Cacti version, not your dependencies:

sudo dpkg -r cacti

To enable the snmp, I will install the snmpd packet:

sudo apt-get install snmpd

Step 3 - Install the new version of Cacti:

Now, I will download Cacti to our website folder:

cd /var/www/web1/web/
sudo wget http://www.cacti.net/downloads/cacti-0.8.6i.tar.gz

Extract Cacti with the command:

sudo tar xzvf cacti-0.8.6i.tar.gz
cd cacti-0.8.6i/
sudo mv * ../
cd ../
sudo rmdir cacti-0.8.6i

Remove the tar.gz files and .htaccess files:

sudo rm *.tar.gz
sudo rm .htaccess
sudo rm config/.htaccess

Step 4 - Setup the Cacti database:

Create the MySQL database (If you prefer, you can use the PHPMyAdmin):

sudo mysqladmin --user=web1_u1

Import the default cacti database:

sudo mysql web1_db1 < cacti.sql

Set up database:

sudo mysql --user=web1_u1 mysql
mysql> GRANT ALL ON web_db1.* TO web1_u1@localhost IDENTIFIED BY mysqlpassword;
mysql> flush privileges;

Step 5 - Configure Crontab and Privileges:

To run every five minutes, and get your system stats, we need to add one line in Crontab:

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

Set the appropriate permissions on cacti's directories for graph/log generation.

sudo chown -R www-data:www-data rra
sudo chown -R www-data:www-data logs

Step 6 - Plugin Architecture:

The Plugin Architecture for Cacti was designed to be both simple in nature and robust enough to allow freedom to do almost anything in Cacti. Cacti itself is designed nicely enough that integrating into it is fairly easy with very little modifications necessary. Eventually Cacti will come with a standard plugin architecture that will allow you to create addons without the need to modify your installation, but until that time comes (we are working on it) you will need to follow the directions below.

sudo wget http://download.cactiusers.org/downloads/cacti-plugin-arch.gzip
sudo tar xvzf cacti-plugin-arch.tar.gz

In the Architecture extracted folder, I will replace the original files with that new files:

sudo mv cacti-plugin-arch/files-0.8.6i /var/www/web1/web

Once this is done, you will have successfully completed installing the Plugin Architecture. It enable to use many plugins developed by others users.

See this link for information about this plugins: http://cactiusers.org/wiki/Homepage.

Step 7 - Configure Cacti:

In the same folder (/var/www/web1/web/):

editor include/config.php

Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration.

$database_default = "web1_db1";
$database_hostname = "localhost";
$database_username = "web1_u1";
$database_password = "mysqlpassword";

Step 8 - First Access:

Go to http://monitor.domain.br, the login page will show.

Cacti Login

Log in the with a username/password of admin. You will be required to change this password immediately. Make sure to fill in all of the path variables carefully and correctly on the following screen.

Step 9 - The Cacti Environment:

Cacti Environment

Step 10 - More information:

To add more plugins to other things like: No-Break, MotherBoard Monitor, HD Monitor, Routers, Servers... Please visit:

Cacti - http://www.cacti.net

Cacti Forum - http://forum.cacti.net

Cacti Users - http://cactiusers.org

Cacti Users Forum - http://forum.cacti.org

Example:

http://www.viniciusmartins.eng.br/cacti/ - User and password: guest 

Specials thanks to:

Luciano Gomes , who wrote and published a nice how to in brazilian portuguese for setting up Cacti for Debian: http://www.vivaolinux.com.br/artigos/verArtigo.php?codigo=3917&pagina=5

Comments and Sugestions:

Go to Forum: http://www.howtoforge.com/forums/showthread.php?p=49710


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by roganlors (registered user) on Fri, 2008-12-05 21:24.

I have an Ubuntu Hardy 8.04 LTS server setup using http://www.howtoforge.com/perfect-server-ubuntu8.04-lts

I followed this how to on installing cacti and encountered only minimal installation issues.

 for the crontab edit /etc/crontab with your favorite editor but make sure that you point the task to the proper file location like:

*/5 * * * * php /var/www/(webuser/web)/poller.php > /dev/null 2>&1

SNMPD Issue for Ubuntu

Apparently by default the snmpd daemon will only listen to requests coming from 127.0.0.1, regardless of what you tell the config.

modify "/etc/default/snmpd"

so that the line

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/ru/snmpd.pid 127.0.0.1'

reads

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'

 reference link below

http://docs.cacti.net/?q=node/434

 

also once installed go to settings and poller tab and make adjustments. once the poller performs a query the rrd's will be written and graphs can be displayed