Connect to your PC using ssh
Be sure we have installed the support packages required for Cacti
Chances are most of these packages are already installed, but it's fine to specify them again as the apt package management system will only install new items.
$ sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server \
php5-mysql snmp php5-snmp rrdtool librrdp-perl librrds-perl php5-cli \
wget
If installing from scratch it is 110MB of additional disk space and about 61MB to download. Remember that "" simply means "newline" - Ask your instructor for help if you don't understand what this means.
Let's become root:
$ sudo -s
# cd /var/www
# wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
If not available remotely or connection is too slow, then:
# wget http://noc.ws.nsrc.org/downloads/cacti/cacti-0.8.8a.tar.gz
Next extract the file:
# tar xvzf cacti-0.8.8a.tar.gz
Make the directory name more friendly.
# mv cacti-0.8.8a cacti
Set the appropriate permissions on cacti's directories for graph/log generation.
# chown www-data:www-data cacti
# cd cacti
# chown -R www-data:www-data *
# mysqladmin --user=root -p create cacti
Enter password: <class password>
# mysql -uroot -p cacti < cacti.sql
Enter password: <class password>
# mysql -uroot -p mysql
Enter password: <class password>
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY '<class password>';
mysql> flush privileges;
mysql> quit
Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration. Most likely you'll only need to change the line with "$database_password" in the first section:
/* make sure these values refect your actual database/host/user/password */
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "<class password>";
$database_port = "3306";
$database_ssl = false;
Now uncomment the line with $url_path just under the line above and add the following:
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
$url_path = "/cacti/";
Now exit and save the file.
Create a cron process for cacti:
# cd /etc/cron.d
# editor cacti
MAILTO=root
*/5 * * * * www-data php /var/www/cacti/poller.php >/dev/null 2>/var/log/cacti/poller-error.log
Now give the right permissions to the log files and create a blank log file:
# cd /var/log
# mkdir cacti
# chown www-data:www-data cacti
# cd cacti
# touch poller-error.log
# chown www-data:www-data poller-error.log
Congratulations! The Cacti base is now installed. To complete installation return to the class presentation and follow the steps for completing the Cacti installation by going to:
http://pcN.ws.nsrc.org/cacti
In a web browser.
NOTE: The exercises should only be done if you have installed Cacti from source. If you install Cacti using "apt-get install cacti" these exercises will not work.
You can find a list of plugins here:
http://docs.cacti.net/plugins
The Settings plugin allows you to specify additional settings for sending email in Cacti. This is very important (actually critical) if you wish to set up Cacti so that it can send email and generate tickets in a ticketing system.
To install the Settings plugin we do:
# cd /var/www/cacti/plugins
# wget http://noc.ws.nsrc.org/downloads/cacti/plugins/settings.tar.gz
*** Optionally if not in the class you can download like this: ***
# wget http://docs.cacti.net/_media/plugin:settings-v0.71-1.tgz
# mv plugin\:settings-v0.71-1.tgz settings.tar.gz
Next extract the file:
# tar xvzf settings.tar.gz
Remove the tar.gz file:
# rm settings.tar.gz
Next get the thold plugin:
# wget http://noc.ws.nsrc.org/downloads/cacti/plugins/thold.tar.gz
*** Optionally if not in the class you can download like this: ***
# wget http://docs.cacti.net/_media/plugin:thold-v0.4.9-3.tgz
# mv plugin\:thold-v0.4.9-3.tgz thold.tar.gz
Next extract the file:
# tar xvzf thold.tar.gz
Remove the tar.gz file:
# rm thold.tar.gz
Now we are ready to configure these two plugins to work with Cacti. The thold plugin will allow us to set thresholds that can cause triggers, such as sending an email message to a ticketing system and automatically generate a ticket when certain conditions are detected (CPU is too hot in the router, max bandwidth exceeded for 10 minutes, system load is to high on a server, etc...).
The steps to do this are done from with the Cacti web interface. As they are graphical please see the document:
cacti-plugin-configuration.pdf
This document is linked in to the Agenda on the wiki for your class. Ask your instructor if you have questions.