Monitor Cisco Routers with Cacti – Graph Your Bandwidth Usage

Cacti is an excellent tool to use to monitor your company’s bandwidth usage.  It is also very simple to add your routers into your cacti configuration.  (Note:  If you need instructions on installing cacti, see Install Cacti on CentOS 6).  Cacti uses the SNMP protocol (Simple Network Management Protocol) to monitor all sorts of devices and has most of the templates that you need to quickly monitor most network and server devices without installing additional plugins.  So, let’s begin to Monitor Cisco Routers with Cacti:

Enable SNMP on the Cisco Router

In order to enable cacti to monitor any device, you must enable SNMP on therouter itself.  Nearly every network device will have a method for doing this, Cisco routers in particular require that you have lines similar to the following in your running-config.


 

SNMP Configuration in Cisco Router:

 snmp-server community mycommunitystring RO
 snmp-server location 1234 StreetName Parkway, Mycity, Mystate, other location information...
 snmp-server contact Jeff Staten 123-456-7890

Other options are also available that will control which IP Addresses can contact your router with SNMP.  Review your router’s documentation for more details specific to your router.

Configure Cacti to Monitor a Cisco Router

Once your router is configured to allow SNMP monitoring, you can now add your router to cacti so you can graph your routers CPU, load average, and interface statistics.  To begin, login to your cacti administration tool using your browser, and under the console tab, choose Devices and then choose the “Add” option from the top right.

Adding a Cisco Router to Your Cacti Configuration

Adding a Cisco Router to Your Cacti Configuration

You will need to populate the fields similar to how I did above in the example:

  • Description – Give your router’s name here.
  • Hostname – Enter your router’s IP address or resolved hostname that cacti can use to contact your router.
  • Host Template – Choose the appropriate template for your router.  Most routers will work just fine with the “ucd/net SNMP Host” template.  However, if your router is a Cisco, you can use the built in “Cisco Router” template that comes by default with cacti.
  • Downed Device Detection – Typically any of the available options will work fine.
  • SNMP Version – You will need to match this to the version that you enabled in your router.  Typically versions 1 and 2 are the defaults.
  • SNMP Community – Put your community string here.  This is kind of a password that is used to communicate with the device.
  • SNMP Port – Port 161 is the default and is more than likely what you should use here.

After you enter the fields above, hit the “Save” button.  It should add the device to the cacti host configuration.

Cisco Router Added Successfully to Cacti Configuration

Cisco Router Added Successfully to Cacti Host Configuration

 

If the information that you entered above is adequate for connecting to the router, you should the SNMP information text in the top center of the screen as shown on the right.  If you don’t see the SNMP text information, you didn’t connect successfully to the SNMP port of the device.  You will need to investigate if the device is configured properly or if you entered the proper connection information.

Create Interface Graphs in Cacti

The next step in graphing your Cisco’s bandwidth and other information in your Cacti server is to create the grScreen Shot 2013-12-17 at 2.28.50 PMaphs.  To create the graphs, you need to have graph templates and data queries.  You can see that I used the “Cisco CPU Usage” graph template and the default “SNMP – Interface Statistics” data query in my example.  You can actually see the snmpwalk of that data queries by clicking on the “Verbose Query” option.  You will want to see the Success status to be sure that your graphs can get the data it needs.

Cacti – Create Graphs for This Host

After Adding a Router to Cacti, You Need to Create Graphs for this Host

After Adding a Router to Cacti, You Need to Create Graphs for this Host

Ok.  Now it is time to create the actual graphs for your device.  You should see the option shown on the right to “Create Graphs for this Host”.  Choose this link.

 

 

 

Choosing Interfaces and Other Metrics to Graph in Cacti

Choosing Interfaces and Other Metrics to Graph in Cacti

This will bring you to the Create New Graphs page shown above.  You can choose from the various interfaces and other monitorable options that cacti found using its snmpwalk of your device.  Click the ones that you want to graph and leave the others off the list.  Hit the “Create” button when you are done and ready to move on.

List of Created Cacti Graphs for your Device

List of Created Cacti Graphs for your Device

 

You will see a list of the graphs that you chose to create similar to the list shown to the left.

 

Make the Device Graphs Available

Now that you have done all of the work of getting your router configured with SNMP and added to your Cacti server.  You need to add your device to the Graph Trees in your Cacti server so you can view the device graphs under the big blue “graphs” tab.

Choose the “Graph Trees” option under the Console tab.

Add Your Router Device to a Cacti Graph Tree

Add Your Router Device to a Cacti Graph Tree

For organizational purposes, you may want to Add a Graph Tree for your routers.  Choose the organization that you want to use in this graph trees area.  I chose to create a Graph Tree named “Network Infrastructure” to group my routers under.  Whatever you choose, it isn’t permanent.  Choose an existing graph tree or create a new one, then select that graph tree and then add your device as a “Tree Item” in your graph tree’s configuration.  To add the router device you will want to choose the “Host” option under the “Tree Item Type”.  This will make your new device an option under the host drop-down list.  Choose the defaults for the other options.  Choose the “Create” button when ready.

Viewing Your Router's Device Graphs in Cacti

Viewing Your Router’s Device Graphs in Cacti

 Viewing Your Cacti Device Graphs

Viewing Your Router's Device Graphs in Cacti

Viewing Your Router’s Device Graphs in CactiT

Finally!  We are ready to view our graphs.  Go to the “graphs” tab on the top, and then navigate through the Graph Tree in the left column to find your device.  Clicking on it should show you your device’s graphs.  If your device has just been added, there may be no data to display in the graph.  Give it 1/2 hour or so and you shoud begin to see data in your graphs like those displayed in the image to the right.

 

That’s it.  You have configured your Cacti server to monitor and graph your Cisco or other router’s network interface usage, load average, and other metrics.

 

 

 

 

The following two tabs change content below.
Jeff has 20 years of professional IT experience, having done nearly everything in his roles of IT consultant, Systems Integrator, Systems Engineer, CNOC Engineer, Systems Administrator, Network Systems Administrator, and IT Director. If there is one thing he knows for sure, it is that there is always a simple answer to every IT problem and that downtime begins with complexity. Seasoned IT professional by day, Jeff hopes to help other IT professionals by blogging about his experiences at night on his blog: http://uptimemadeeasy.com. You can find Jeff on or LinkedIn at: LinkedIn or Twitter at: Twitter

Latest posts by Jeff Staten (see all)

7 comments for “Monitor Cisco Routers with Cacti – Graph Your Bandwidth Usage

  1. Karthikeyan.L
    January 13, 2014 at 9:28 pm

    Hi Jeff.
    Your Tutorial looks good, is there any way to monitor the live traffic like a streaming graph in cacti ?

    What is the learning period on cacti in fetching the data from end device.

  2. January 13, 2014 at 10:27 pm

    Karthikeyan,
    So, it isn’t live, but it isn’t too far behind either. The frequency of the checks in the /etc/cron.d/cacti cron file is:
    */5 * * * * cacti /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
    So, you know that the data in the graph is a maximum of 5 minutes old.

  3. Greywolf
    May 13, 2014 at 8:41 pm

    This was a breeze to set up, but is there any nice way to *graph* the cumulative data total for the month? Extant graph templates include it as a comment but not as a graph item…

  4. May 13, 2014 at 9:40 pm

    Greywolf,
    I think that what you are looking for is viewed by clicking on the graph directly which will take you into different views of your graphs (daily, weekly, monthly, yearly, etc…). If what you truly want is a bar chart of the data per month, you may have to resort to excel.

  5. June 11, 2014 at 7:31 am

    Thank you so much Jeff. I have gone through your tutorial and I got it up and running in no time. Do you have a similar documentation for setting up Cacti with netflow?

  6. June 11, 2014 at 7:44 am

    Gauss,

    Thank you for your comment. I haven’t written an article yet on netflow but it sounds like a great topic for a future article.

    Jeff

  7. Anthony Gallucci
    November 6, 2014 at 9:20 am

    Thanks for the tutorial.

    Without an interface description that be can configured to indicate what or where the interface connects the graph display page require some sort of map or separate document.

    Is there any way to include the associated description on the interface to be included or the individual graph?

    Thanks,
    Tony

Leave a Reply

Your email address will not be published. Required fields are marked *