Cacti: RRDTool-based Graphing Solution - Features and Functions
(Page 2 of 4 )
On the previous page we introduced the way Cacti “gathers” its data from RRDTool. This is accomplished by either of its two back-ends: first we have a PHP script (cmd.php) that should suffice for small-to-medium installations; on the other hand we also have a full-fledged poller written in C—this should be used when network monitoring of thousands of hosts is required. These “pollers” grab the data.
The way things get done is via a scheduler. In the case of *nix that’s Crontab, while for Microsoft Windows it’s the Windows Scheduler. Cacti approaches the graph creation with a multi-user technique; this means the system administrator can set up which users need what kind of graphs, and ultimately those users can be seamlessly notified with the aforementioned reports.
Check out the following two graphs. These are dynamically created every five minutes (meaning the graphs are refreshed/updated). These fancy charts are very useful because you can set up event handlers later (via script extensions) or send notifications if some of the measured values reach peaks or drop below some specified level.
Cacti does not have an agent, unlike some other commercial suites that require the deployment of extra agents. However, one of the most outstanding capabilities of Cacti is the SNMP support. SNMP stands for Simple Network Management Protocol (more info: Wiki link). This protocol is pretty complex and there are various versions of it, but the main idea is that it’s ultimately very useful.
Every network-connected device can be monitoring through the SNMP protocol. Via this protocol, system administrators can find out when something goes wrong and query and accomplish specific tasks related to network monitoring of devices. Cacti is one hundred percent compatible with the SNMP standard, which means that you can create custom graphs and monitoring shell scripts to monitor network devices.
You can write your own scripts somewhat easily. For example, you could monitor the packet loss of specific hosts by deploying the ping command one hundred times, exporting the result into a text file, and then extracting just that part where it says (% loss) or something similar. You could then get Cacti to draw some charts based on the results.
Ping statistics for 74.125.45.100:
Packets: Sent = 100, Received = 100, Lost = 0 (0% loss),
In the above example, you’d set up Cacti to receive data from an external script. Another solution is to gather data via SNMP. Moreover, you can create graph templates if there is more than one graph in the same fashion, but with different values (charting different things). In that case, it makes sense to design a template first.
Just as with graph templates, you can also create data templates. These are good if multiple data types share the same characteristics, such as min/max values, heartbeat (max delay that can pass prior declaring the data as unknown), etc.
Now that we’ve looked at what Cacti is about, let’s get it up and running!