Cacti on FreeBSD 6.2

Prerequisites:

FreeBSD (Base + Autoconf, Automake, Bash and GCC)
GD
Apache
MySQL (and phpMyAdmin)
Net-SNMP
Perl (with modules)
PHP
RRDtool

Overview:
 Step #1 - Download, Unzip, Configure and Install Cacti
 Step #2 - Download and configure add-ons, plug-ins and templates

Step #1

Cacti – Network graphing solution designed to harness the power of RRDtool

Home: 

 http://www.cacti.net

# Download (Notes: Users behind a Proxy Server should read this and users without Internet but have a CDRom read this.)
cd /usr/src
fetch http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz

# Unzip and Untar
tar xvf cacti-?.?.*.tar.gz

# Put Cacti under your public web area document root
mv /usr/src/cacti-?.?.?? /opt/apache/htdocs/cacti/

# Create the MySQL database:
/opt/mysql/bin/mysqladmin --user=root -p create cacti

# Import the default cacti database:
/opt/mysql/bin/mysql --user=root -p cacti < /opt/apache/htdocs/cacti/cacti.sql

# Create a MySQL username and password for Cacti
/opt/mysql/bin/mysql --user=root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
GRANT ALL ON cacti.* TO cactiuser@"%" IDENTIFIED BY 'cactipassword';
flush privileges;
exit


# Edit include/config.php and specify the MySQL user, password and database for your Cacti configuration
vi /opt/apache/htdocs/cacti/include/config.php
$database_default = "cacti";
$database_hostname = "
localhost";
$database_username = "
cactiuser";
$database_password = "
cactipassword";

$config['url_path'] = '/cacti/';

# Add a line to the very bottom of your /etc/crontab file
vi /etc/crontab

# Update directory permissions
chown -R www:www /opt/apache/htdocs/cacti/


# Point your web browser to:
http://YourServersIP/cacti/

# 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 #2 - Install the Plug-In Architecture (PIA)

Get the "Plug-In Architecture" installed

Home: 

 http://www.CactiUsers.org

# Get the "Plug-in Architecture"
cd /usr/src
fetch http://cactiusers.org/downloads/cacti-plugin-arch.tar.gz
tar xvf cacti-plugin-arch.tar.gz
cp -R /usr/src/cacti-plugin-arch/files-0.8.7b/ /opt/apache/htdocs/cacti/

# Edit your Cacti global configuration file
vi /opt/apache/htdocs/cacti/include/global.php

# Set the file permissions in the web directories so the web server has permission to display them
chown -R www:www /opt/apache/htdocs

 

 



Step #3 - Get some Cacti Plug-Ins of your choice

Get some Cacti Plug-ins! – Adds functionality

Home: 

 http://www.CactiUsers.org
 Compatible List: http://forums.cacti.net/viewtopic.php?t=14985

# Get some Cacti "Plug-Ins" installed and working!

# Settings plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/settings.tar.gz
tar xvf settings.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Hostinfo plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/hostinfo.tar.gz
tar xvf hostinfo.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Discovery plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/discovery.tar.gz
tar xvf discovery.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Devices plug-in
cd /usr/src
fetch http://wotsit.thingy.com/haj/cacti/devices-0.4.zip
unzip devices-0.4.zip
mv devices /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Superlinks plug-in
cd /usr/src
fetch http://wotsit.thingy.com/haj/cacti/superlinks-0.72.zip
unzip superlinks-0.72.zip
mv superlinks /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Update plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/update.tar.gz
tar xvf update.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Tools plug-in (Network Tools)
cd /usr/src
fetch http://cactiusers.org/downloads/tools.tar.gz
tar xvf tools.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Monitor plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/monitor.tar.gz
tar xvf monitor.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Thold (Threshold) plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/thold.tar.gz
tar xvf thold.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Zond plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=11607
mv "download.php?id=11607" zond_v0.34a.tar.gz
tar xvf zond_v0.34a.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Manage plug-in
cd /usr/src
fetch http://gilles.boulon.free.fr/manage/manage-0.5.1.zip
unzip manage-0.5.1.zip
mv /usr/src/manage/ /opt/apache/htdocs/cacti/plugins/

# Convert line breaks with carriage returns
cd /opt/apache/htdocs/cacti/plugins/manage
dos2unix *
cd wmi/
dos2unix *
cd ..
cd sql/
dos2unix *
cd ..
cd include/
dos2unix *
cd ..

# Apply Streaker's fixes!
# Some files needed to be updated with global.php includes which are listed:
# manage_ajax.php:include_once("./include/global.php");
# manage_check.php:include(dirname(__FILE__) . "/../../include/global.php");
# manage_debug.php:include_once("./include/global.php");
# manage.php:include_once("./include/global.php");
# poller_manage.php:include(dirname(__FILE__) . "/../../include/global.php");
# Couple more things:
# 1. The following line needs to be edited in manage_check.php:
#
include_once($config["base_path"] . "/plugins/thold/thold_functions.php");
# it did read
# include_once($config["base_path"] . "/plugins/thold/thold-functions.php");
# 2.
chmod +x poller_manage.php needed to be done on my system to make the poller work right.

# Fix the database

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# MAC Track plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/mactrack.tar.gz
tar xvf mactrack.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Fix up the database:
cd /opt/apache/htdocs/cacti/plugins/mactrack/
dos2unix *
/opt/mysql/bin/mysql --user=root -p cacti < /opt/apache/htdocs/cacti/plugins/mactrack/mactrack.sql.0.0.1
/usr/local/bin/php /opt/apache/htdocs/cacti/plugins/mactrack/database_upgrade.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Aggregate plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=11439
mv "download.php?id=11439" aggregate-v064.tgz
tar xvf aggregate-v064.tgz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Docs plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/docs.tar.gz
tar xvf docs.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# RRDCleaner plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=10935
mv "download.php?id=10935" rrdclean-0.32.tgz
tar xvf rrdclean-0.32.tgz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# B.A.S.E. plug-in
# Prerequisite: Have a working Snort / B.A.S.E. installation already configured and running - Here is my FreeBSD Snort / BASE instructions!
cd /usr/src
wget http://forums.cacti.net/download.php?id=9002
mv "download.php?id=9002" base-0.1.tar.gz
tar xvf base-0.1.tar.gz -C /opt/apache/htdocs/cacti/plugins/
mv /opt/apache/htdocs/cacti/plugins/base-0.1/base/ /opt/apache/htdocs/cacti/plugins/base/
rm -R /opt/apache/htdocs/cacti/plugins/base-0.1

# Convert to UNIX
cd /opt/apache/htdocs/cacti/plugins/base/
dos2unix *

# Hack source for FreeBSD and implement Streaker's fixes too
vi /opt/apache/htdocs/cacti/plugins/base/base.php

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Instructions not yet completed!

# Boost plug-in
cd /usr/src
fetch http://cactiusers.org/downloads/boost.tar.gz
tar

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Report IT plug-in
cd /usr/src
fetch http://superb-east.dl.sourceforge.net/sourceforge/cacti-reportit/reportit_v051.tar.gz
tar xvf reportit_v051.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Note: Additional configuration via the Cacti web interface is required to run this plug-in, please read and follow the author's instructions!

# Poller Performance plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=8695
mv "download.php?id=8695" pollperf-v0.32.tgz
tar xvf pollperf-v0.32.tgz -C /opt/apache/htdocs/cacti/plugins/

# Update the cacti database

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Instructions not yet completed!

# Configmanager plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=6449
mv "download.php?id=6449" configmanager0.75.zip
unzip configmanager0.75.zip
mv /usr/src/configmanager0.75 /opt/apache/htdocs/cacti/plugins/configmanager
wget http://forums.cacti.net/download.php?id=10980
mv "download.php?id=10980" sharednetworkclass0.36.zip
unzip sharednetworkclass0.36.zip
mv /usr/src/sharednetworkclass0.36/ /opt/apache/htdocs/cacti/plugins/sharednetworkclass
cp /opt/apache/htdocs/cacti/plugins/configmanager/secure.cfg.example /opt/apache/htdocs/cacti/plugins/configmanager/secure.cfg
cp /opt/apache/htdocs/cacti/plugins/configmanager/securecompare.cfg.example /opt/apache/htdocs/cacti/plugins/configmanager/securecompare.cfg

# Convert to UNIX format
cd /opt/apache/htdocs/cacti/plugins/configmanager/
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/temp
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/scripts
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/include
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/include/treeview
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/include/jscalendar
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/include/jscalendar/lang
dos2unix *
cd /opt/apache/htdocs/cacti/plugins/configmanager/html
dos2unix *
 

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Subnet Calculator plug-in
cd /usr/src
wget http://forums.cacti.net/download.php?id=6573
mv "download.php?id=6573" ipsubnet.tar.gz
tar xvf ipsubnet.tar.gz -C /opt/apache/htdocs/cacti/plugins/
mv /opt/apache/htdocs/cacti/plugins/ipsubnet?.?? /opt/apache/htdocs/cacti/plugins/ipsubnet/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxe

# Cycle plug-in
cd /usr/src
mkdir cycle
cd cycle
# Download http://forums.cacti.net/download.php?id=10912
wget http://forums.cacti.net/download.php?id=10912
mv "download.php?id=10912" cycle.zip
unzip cycle.zip
cd ..
mv /usr/src/cycle/ /opt/apache/htdocs/cacti/plugins/

# Fix 0.4 issue
vi /usr/opt/apache/htdocs/cacti/plugins/cycle/ajax.php
# Add this additional include line near the top: include_once("./include/global.php");

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# NTop plug-in
# Prerequisite: Have a working NTop installation already configured and running - Here is my FreeBSD NTop instructions!
cd /usr/src
fetch http://cactiusers.org/downloads/ntop.tar.gz
tar xvf ntop.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Instructions not yet completed!

# Weathermap plug-in
cd /usr/src
fetch http://www.network-weathermap.com/files/php-weathermap-0.95b.zip
unzip php-weathermap-0.95b.zip
mv weathermap /opt/apache/htdocs/cacti/plugins/weathermap
cp /opt/apache/htdocs/cacti/plugins/weathermap/editor-config.php-dist /opt/apache/htdocs/cacti/plugins/weathermap/editor-config.php

# Edit the Weathermap configuration file
vi /opt/apache/htdocs/cacti/plugins/weathermap/editor-config.php
$cacti_base = "/opt/apache/htdocs/cacti";
$config['base_url']='http://172.28.0.12/cacti/';

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Syslog plug-in  (Previously known as the Haloe plug-in)
cd /usr/src
fetch http://cactiusers.org/downloads/syslog.tar.gz
tar xvf syslog.tar.gz -C /opt/apache/htdocs/cacti/plugins/

# Configure the syslog database for the Syslog plug-in
# Create the syslog database and import the table structures used by the Syslog Cacti plug-in
/opt/mysql/bin/mysqladmin --user=root -p create syslog
/opt/mysql/bin/mysql --user=root -p syslog < /opt/apache/htdocs/cacti/plugins/syslog/syslog.sql


# Give permission for the cacti database user to access the syslog database tables

/opt/mysql/bin/mysql --user=root -p mysql
GRANT ALL ON syslog.* TO cactiuser@localhost IDENTIFIED BY 'cactipassword';
GRANT ALL ON syslog.* TO cactiuser@"%" IDENTIFIED BY 'cactipassword';
flush privileges;
exit

# Also edit the Syslog configuration to access the database
vi /opt/apache/htdocs/cacti/plugins/syslog/config.php
$haloedb_username = "cactiuser";
$haloedb_password = "cactipassword";

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Complete the Syslog-NG instructions to get messages flowing into the database
http://www.NMSWorld.com/UNIX/Syslog-NG.htm

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

# Instructions not yet completed!

# Reports plug-in
cd /usr/src
fetch http://download.cactiusers.org/downloads/reports.tar.gz
tar xvf reports.tar.gz -C /opt/apache/htdocs/cacti/plugins/
# Configure the Reports table in the cacti database
/opt/mysql/bin/mysql --user=cactiuser -p cacti < /opt/apache/htdocs/cacti/plugins/reports/reports.sql
cactipassword

# Add the plug-in to the array
vi /opt/apache/htdocs/cacti/include/global.php

# Reset file permissions
chown -R www:www /opt/apache/htdocs

# Log in to your Cacti web interface and verify that the plug-in is  working.
# Note: Many plug-ins require you to allow permission for each web user to view and use the new plug-in.
#          From the Cacti web interface, Click the "Console" tab then click "User Management" and pick the user of your choice and verify the check boxes

 

Step #3 - (Optional: Templates and scripts for specific devices you own)

Get some Templates and Scripts! – Adds functionality and simplifies device management

Home: 

 http://forums.cacti.net/

# Example below are for some devices I have on my networks
# Addons are listed here: http://forums.cacti.net/forum-5.html
# Scripts and Templates here: http://forums.cacti.net/forum-12.html

# Cisco 6500 Series Template
http://forums.cacti.net/about4844.html

# Cisco Memory Template
http://forums.cacti.net/about3873.html

# Cisco CAT/OS Template
http://forums.cacti.net/about4356.html

# Cisco 2900-3500 Template
http://forums.cacti.net/about4843.html

# UNIX Multiping
http://forums.cacti.net/about6662.html

# Advanced PING
http://forums.cacti.net/about9484.html

# RRD Cleaner
http://forums.cacti.net/about5852.html

# Weather Map
http://wotsit.thingy.com/haj/cacti/php-weathermap/php-weathermap.html

 
 

Step #4 (Optional - The cactid poller is a high speed binary vs. the built-in PHP poller CMD.php)

Spine (Cactid)Poller for Cacti that primarily strives to be as fast as possible

Home: 

 http://www.cacti.net/cactid_info.php

# Download (Notes: Users behind a Proxy Server should read this and users without Internet but have a CDRom read this.)
cd /usr/src
fetch http://www.cacti.net/downloads/spine/cacti-spine-0.8.7a.tar.gz

# Unzip
tar xvf cacti-spine-0.8.7a.tar.gz

# cd
cd cacti-spine-0.8.7a

# Before compiling:
LD_LIBRARY_PATH=/usr/local/lib:/opt/net-snmp/lib/:/opt/mysql/lib/mysql/
export LD_LIBRARY_PATH

# autoheader
# autoconf
# automake
# aclocal
# export FORCE_PKG_REGISTER=1
# cd /usr/ports/devel/libtool15
# make install clean

# Symlink the libtool config directory to help FreeBSD pass Linux based tests
ln -s /usr/local/share/libtool /usr/share/libtool

# This doesn't help or hurt FreeBSD
libtoolize --copy --force

# Cactid configure options:
./configure --prefix=/opt/apache/htdocs/cacti --with-mysql=/opt/mysql --with-snmp=/opt/net-snmp

# Compile and Install
make
make install

# or?
gmake
gmake install

# Symlink possible config locations for Spine:
ln -s /opt/apache/htdocs/cacti/etc/spine.conf /etc/spine.conf
ln -s /opt/apache/htdocs/cacti/etc/spine.conf /etc/cactid.conf

# Edit the actual Spine config
vi /opt/apache/htdocs/cacti/etc/spine.conf

# Make sure you get rid of the supplied default config file (Spine may use it if it finds it)
rm /usr/src/cacti-spine-0.8.7a/spine.conf

# Edit /etc/crontab
vi /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/lib
HOME=/var/log
LD_LIBRARY_PATH=/usr/local/lib:/opt/net-snmp/lib/:/opt/mysql/lib/mysql/

# Test cactid
/opt/apache/htdocs/cacti/bin/spine

# Log in to cacti and add the edit the cactid path:
/opt/apache/htdocs/cacti/bin/spine

# Remember to set full paths on scripts if using cactid
 
Important Notice for Cactid 0.8.6g and Onward

As of Cactid version 0.8.6g, scripts are no longer executed through the poller with a shell. This greatly increases speed as only one process needs to be created for every script call rather than two.

Because of this change, scripts that rely on the shell environment's PATH will no longer work. You must go through your scripts under "Data Input Methods" and make sure that the "Input Script" field always contains the complete path to any binary that is referenced. After making this change, you should clear your poller cache under "Utilities" for the changes to take effect.

For example, a script that was called as "perl /path/to/my/script.pl", must now be called as "/usr/bin/perl /path/to/my/script.pl".

# Performance tweaking notes to MySQL that will help cactid:
# Make sure your MySQL server's /etc/my.cnf has been tuned up:
vi /etc/my.cnf
max_connections = 1000
max_heap_table_size = 128000000

# Use the MEMORY (Heap) storage engine for the poller_output table
/opt/mysql/bin/mysql --user=root --password mysql
ALTER TABLE `cacti`.`poller_output` MODIFY COLUMN `output` VARCHAR(2048) NOT NULL DEFAULT '' , ENGINE = MEMORY;
quit;

# Restart MySQL
/usr/local/etc/rc.d/mysql.sh restart

# Check out your MySQL settings and tune /etc/my.cnf more as desired
mysqladmin -u root -p var ext stat ver

 

Step #5 - (Optional: Setup "LDAP" user authentication for users in Windows Active Directory)

Authenticate your users (Technicians) via LDAP! – Simplifies user password management

# Log into the Cacti web interface as the admin user
http://YourServerNameOrIP/cacti

# Click on "User Management" under the "Console" tab in the "Utilities" section

# Click "Add" in the upper right corner of the page to add a new Cacti user

# Create a typical "Technician" level access account with "View Only" rights that LDAP will use as a template during first logon of LDAP users

# Make sure you come back in and turn ON the ability for this "Technician Template" user to view graphs!

# Set all graphs to "Allow" and click "save"

# You should now see that our "Technician Template" we will use for LDAP authentication is set for "ALLOW"

# Now just to be sure everything is set correctly, log in to Cacti as the "Technician" user and verify that this template user works correctly
Close all web browsers you may have open.
http://YourServerNameOrIP/cacti
Log in as user: Technician (with that long password you set earlier)

# When you are satisfied with your "Technician Template" user for LDAP authentication it is time to turn on LDAP Authentication as an option!
# Close all web browsers you may have open and login to Cacti as the local "admin" user
http://YourServerNameOrIP/cacti
Log in as user: admin

#  Configure LDAP settings
# Note: <username> is a variable, you need to keep <username> and just edit the "@domain" part
# More examples of the LDAP syntax can be found here: http://forums.cacti.net/viewtopic.php?t=11595
#
LDAP Server - Enter the DNS name of your LDAP Server
# LDAP DN - canonical name (cn) will be templated with the <username> given in the logon screen.
#                     Together with the password of the logon screen, cacti will perform an LDAP Bind request. If this succeeds, cacti will assume authentication success.
#                      ou= enter your LDAP-ou here
#                       o = enter your LDAP-o here
#                       c = enter your LDAP c here
# LDAP Cacti Template User - Enter the name of an already existing cacti user here. The settings of this user will be copied to a user who logs on for the first time.

# After you setup LDAP and clicked "save" you should close any web browsers you may have open and try logging in as a domain user via LDAP!