This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

Network monitoring with Cacti

By Aditya Nag on October 28, 2005 (8:00:00 AM)

Share    Print    Comments   

GNU/Linux is without doubt a brilliant server OS, but monitoring your Linux server can be a challenge. There are a few powerful tools available, such as MRTG, the Multi Router Traffic Grapher, but setting them up can be an exercise in frustration for first-time users. By contrast, Cacti, a graphing program for network statistics, is designed to be easy for relatively inexperienced systems administrators to use, while at the same time being powerful enough to be used in complex networks.

Cacti's Web site describes the software as

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.

RRD stands for Round Robin Database, which is a system to store and display time-series data such as network bandwidth, machine-room temperature, and server load average. Cacti leverages the features of RRDtool and stores the data it collects in Round Robin archives.

I recently set up three new servers at my university. To monitor and track various parameters, I decided to install Cacti to see if it lived up to the description. I previously used MRTG to monitor our network, but I was never able to configure it to my complete satisfaction. MRTG is pretty complex, and takes a lot of getting used to.

The network in question comprises about 600 nodes. Three Linux servers prove DHCP, DNS, Squid network caching, and other services. The devices that I needed to monitor were the three servers themselves, some Layer 3 managed switches, Wi-Fi access points, and a few workstations.

Installation and configuration

Cacti installation was simple. After downloading the latest tarball (version 0.8.6g) I had to set up the MySQL database and change a few lines in one file. The installation instructions are easy to follow. It took me about five minutes to install Cacti. After logging in and changing the default password, I was ready to start monitoring my network.

After logging in, you have to tell Cacti about the devices that you want to monitor. Cacti comes with a list of common devices, such as Linux servers, Cisco routers, NetWare servers, and even Windows 2000/XP workstations. If your device is not in the list, you can create a generic device, and specify the parameters you need to monitor. You can also save this as a template for the future. The user-friendly Web interface coupled with the documentation makes this a refreshing change from MRTG.

After you create the devices, you have to select the parameters that you want to monitor for each device, and set up the graphs. Cacti provides templates for common parameters such as CPU usage, network traffic, users logged in, and the like. You can quickly make your own templates as well. It took me a few minutes to set up the graphs for the three Linux servers. The parameters I wanted to track were load averages, bandwidth used, and processes running. Cacti already offers templates for these, so setting them up was easy. To monitor the switches, I had to create my own templates, which was slightly more complex, but the documentation came to my rescue.

Graphing
Click to enlarge

All the information Cacti collects is useful only if it is presented properly. If you are monitoring a handful of devices, you can go through each graph quickly, but if you are tracking a few hundred parameters, that is simply not possible. To help you understand the data, Cacti lets you organize the graphs in various ways. You can set up graph trees, collecting all graphs of one type under one umbrella graph. You can have a graph in two or more trees as well. In my case, I set up individual trees for each parameter, with all the graphs of that parameter in each tree. For example, in the graph tree for bandwidth, the bandwidth graphs of all the devices are collected. Every device has an individual graph tree as well. This allows me to quickly check by parameter or by device to make sure everything is running smoothly. You can set up the trees in myriad different ways according to your needs.

Cacti can graph just about anything you throw at it. The variety of templates that come with the default installation is sufficient to take care of simple networks, and you can create your own data types and templates for more complex networks. However, Cacti cannot display tabular numeric data.

Cacti is not limited to using SNMP data. You can feed Cacti the paths to an external script or command -- standard *nix bash scripts, Perl scripts, or any script that runs from the command prompt of your Linux server. Cacti gathers the data in a cron job and populates a MySQL database or the round robin archives. Users have developed more than 20 scripts for Cacti, ranging from collecting data from Sendmail queues to gathering Apache statistics.

Cacti does not take too many resources on the host machine. It is written in PHP, and renders quickly. I had it tracking about 30 parameters over a dozen different devices, and it was snappy to use.

By default, Cacti allows anyone to view the graphs at http://<your hostname>/cacti/graph_view.php, but you can turn this access off.

You can authorize multiple administrators as Cacti users. You can add users and give them rights to only certain areas of Cacti. This allows you to create some users that can change graph parameters, and others that can only view graphs. Each user can maintain his own settings when it comes to viewing graphs.

Conclusion

Cacti does a good job of monitoring network usage. I encountered no bugs or flaws in it, but you might want to test Cacti on a spare box before you implement it in a critical production environment. The software is extremely extensible, and can be used to monitor very large networks, tracking parameters as diverse as temperature and humidity. The user community is active, and development is proceeding at a rapid clip.

Cacti is an extremely useful and easy to use tool for network administrators, and best of all, you do not need to be a network guru to use it.

Share    Print    Comments   

Comments

on Network monitoring with Cacti

Note: Comments are owned by the poster. We are not responsible for their content.

I just have to remember Linux programs Names

Posted by: Anonymous Coward on October 28, 2005 09:09 PM
Few secound what does cacti the plant have to do with network. Ok the program cacti.

#

Good for LANs only

Posted by: Anonymous Coward on October 28, 2005 10:58 PM
These type of tools tend to fall apart when you try to monitor a WAN, since traversing NAT firewalls break the SNMP.

However, the net-snmp package has the ability to use different ports, allowing one to use port forwarding on a firewall to map all the devices behind it.

A good project to look at for monitoring a WAN is Zabbix: <a href="http://www.zabbix.com/" title="zabbix.com">http://www.zabbix.com/</a zabbix.com>

Easy to set up, alsmost in the Just Works category.

#

Looks nice

Posted by: Anonymous Coward on October 29, 2005 09:24 AM
From reading the article and looking at the screenshots, it seems really nice.<nobr> <wbr></nobr>:)

#

Re:Looks nice

Posted by: Anonymous Coward on August 15, 2006 08:39 AM
Take a look at Intelica networks products for network monitoring. Built on high speed packet recording technology, it scales well for enterprise networks. Go to www.intelicanetworks.com for more information.

#

Re(1):Looks nice

Posted by: Anonymous [ip: 84.61.62.175] on October 03, 2007 07:17 PM
Cacti is known to poll > 1000 hosts in less then 60 sec. We currently poll > 20.000 different data sources in about 40 sec with a single midrange server. It serves well on worldwide network/systems monitoring in some Fortune 500 companies.

#

Cacti is a nice product, for the most part.

Posted by: Anonymous Coward on October 29, 2005 10:54 AM
It doesn't scale up as well as I had hoped. I'm monitoring about 150 Windows and 30 Linux/UNIX servers, and about 100 network devices (switches, routers, etc).

It's running on a 2Ghz Xeon, and it barely keeps up. I'm about to pop another CPU in it to help with the load.

The other thing to note is it is a little touchy - Some bad data gets put in, (like an unresolvable DNS name for a host) and things can get angry. (like the poller stops collecting data partway through data collection)

Overall, however, I've found my experience to be far more positive than almost any OSS network trending product I've used.

#

Re:Cacti is a nice product, for the most part.

Posted by: Anonymous Coward on October 29, 2005 11:34 AM
Sounds like your running the php pooler. If you switch to the deamon you'll get great performance. I am graphing a few hundred and it only takes a 30 seconds once every 5 minutes on less of a machine than yours.

#

Re:Cacti is a nice product, for the most part.

Posted by: Anonymous Coward on October 30, 2005 12:07 AM
Overall, however, I've found my experience to be far more positive than almost any OSS network trending product I've used.

For the sake of comparison, could you list some of those trending products here?

#

ravindra mudumby--Network monitoring with Cacti

Posted by: Administrator on October 30, 2005 01:48 AM
When it comes to network monitoring/graphing, Tobi Oetiker's RRDTool does it best. It gives you the ability to put data into a database, then represent that data on a graph as you see fit.

One drawback to RRDTool, is that by itself it is not a complete package for users wanting to graph their own networks. This is where cacti's job comes in. Cacti brings the power of RRDTool to a friendly web interface making it easy to graph anything using RRDTool.

Other frontends have been created in the past that simply emulate MRTG using RRDTool as a backend. Cacti, on the other hand exploits RRDTool's full potential; utilizing Round Robin Archives, CDEF's, Data Sources, and Graphs.

#

Re: ravindra mudumby--Network monitoring with Cacti

Posted by: Anonymous [ip: 147.51.59.3] on November 29, 2007 03:47 PM
You fuck tard...cacti uses rrdtool to display back the data

#

Try OpenNMS Instead

Posted by: Administrator on November 01, 2005 02:54 AM
I ran Cacti for a couple of years. Don't ignore the fact that this is a 0.86 release. OpenNMS (<a href="http://www.opennms.org/" title="opennms.org">http://www.opennms.org/</a opennms.org>) is a much better tool for network monitoring and management. It uses RRD tool as well and is much more stable and full featured. Among it's best features is 'discovery' where it will monitor an entire subnet and being data collection if a new node is detected, automatically.

I found the configuration tasks in Cacti would break the database layout and were needlessly complicated.

#

Re: Try OpenNMS Instead

Posted by: Anonymous [ip: 84.61.62.175] on October 03, 2007 07:25 PM
While I agree, that the autodiscovery feature of OpenNMS is really great, I'd like to mention the Cacti Plugin named DISCOVERY dedicated to the very same goal. Please discover the new strength of Cacti that comes with those more than 30 plugins like threshold monitoring (THOLD), tabular reporting (REPORTIT), online performance observation (ZOND) and more

#

Re(1): Try OpenNMS Instead

Posted by: Anonymous [ip: 130.166.42.69] on October 06, 2007 12:24 AM
Not quite sure where you get 30. The Cacti download page lists exactly 12. Some are duplicate functionality such as monitoring up/down. I also find Cacti a nightmare to configure. While it is said to be designed to be easier I find it to be more difficult.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya