Sunday, April 26, 2015

Installing the Cacti Flowview plugin for Debian 7 Wheezy

Preparing for plugin installation

 # According to the file, /usr/share/cacti/site/plugins/README.Plugins , the directory structure shall be moved into a new location

sudo mkdir /usr/local/share/cacti/plugins
sudo mv /usr/share/cacti/site/plugins/* /usr/local/share/cacti/plugins/

# Remove the empty /usr/share/cacti/site/plugins directory

sudo rmdir /usr/share/cacti/site/plugins


# Create the following symlinks:

sudo ln -s /usr/local/share/cacti/plugins /usr/share/cacti/site/plugins
sudo ln -s /usr/share/cacti/site/include /usr/local/share/cacti/include
sudo ln -s /usr/share/cacti/site/lib /usr/local/share/cacti/lib


Installing the Flowview plugin

# The current plugin version is fetched from this URL:
http://docs.cacti.net/plugin:flowview

cd /usr/local/share/cacti/plugins/
sudo wget http://docs.cacti.net/_media/plugin:flowview-v1.1-1.tgz
sudo mv plugin\:flowview-v1.1-1.tgz flowview-v1.1-1.tgz
sudo tar xvf flowview-v1.1-1.tgz

# Now proceed to  'Plugin Management' in the Cacti web.
Flowview should be listed among the available plugins.
Install and then enable the plugin by clicking in 'Actions' column.
A 'Flows' tab should now be available at the top of the page

Configure PHP timezone

# Set your local  timezone
 sudo nano /etc/php5/apache2/php.ini 
     date.timezone =Europe/Stockholm

sudo service apache2 restart

Install and configure flow-tools


sudo apt-get install flow-tools

# Prepare a storage directory for your different netflows. Here I will configure my WAN router.
sudo mkdir -p /var/flow/wanrouter

# In Cacti->Console->Settings->Tab:Misc
# Set 'Flows Directory' to /var/flow
# Add your local DNS caching server or Googles 8.8.8.8

# Replace the native flow-capture init script with the Flowview specific replacement
sudo service flow-capture stop
sudo cp /etc/init.d/flow-capture /etc/init.d/flow-capture.org
sudo cp /usr/local/share/cacti/plugins/flowview/flow-capture /etc/init.d/flow-capture

Add a flow-capture listener

# Edit flow-capture configuration. Comment out the existing examples
# flow-capture is not configured by this file. It is configured in the Cacti Listener Tab.

sudo nano /etc/flow-tools/flow-capture.conf
 

# In Cacti add the a listener for the wanrouter
Tab:Flows ->Tab: Listeners -> Add

# Restart flow-view service when a new listener has been added
sudo service flow-capture start

# NOTE, deleteing listeners does not work in flowview 1.1-1
# For a solution apply the patch here:
# http://bugs.cacti.net/view.php?id=2463



Configure your device to send netflow information

# My router is an Ubiquity Edgerouter POE with the WAN interface connected to eth0

configure
set system flow-accounting interface eth0

# Needs version 9 or 10;  set system flow-accounting netflow enable-egress

set system flow-accounting netflow server 192.168.1.56 port 2055
set system flow-accounting netflow version 5
commit

# The commit messages says that egress accounting is registered, even though I did not configure the enable-egress command above. Maybe some kind of misunderstanding from by side.


Verify netflow sent from the router

Verfify that netflow is sent from your device by sending the file contents to the flow-print command
flow-print < /var/flow/wanrouter/<Date>/<filename>

Additional Netflow software

Here is an extensive list of open source and closed source software



3 comments:

  1. Hi, I have Cacti installed on Debian 7. I have installed the flowview plugins successfully. but when I login on cacti and browse to plugin management I don't see any plugins appearing. Can you tell me what would be wrong?

    ReplyDelete
    Replies
    1. is the plugin architecture installed?
      http://askubuntu.com/questions/138283/how-do-i-install-cacti-8-7i-with-pia-3-1plug-in-architecture-for-12-04-server

      Delete
  2. Hello Anders
    First of all - excellent tutorial!
    Everything works like a charm.

    ReplyDelete