Cacti (home)ForumsDocumentation

This is an old revision of the document!


Basics

Principles of Operation

Cacti operation may be divided into three different tasks:

Data Retrieval

First task is to retrieve data. Cacti will do so using its Poller. The Poller is executed from the operating system's scheduler, e.g. crontab for Unix flavored OSes.

In current IT installations, you're dealing with lots of devices of different kind, e.g. servers, network equipment, appliances and the like. To retrieve data from remote targets/hosts, cacti will mainly use the Simple Network Management Protocol SNMP. Thus, all devices capable of using SNMP will be eligible to be monitored by cacti.

Later on, we demonstrate how to extend cacti's capabilities of retrieving data to scripts, script queries and more.

Data Storage

There are lots of different approaches for this task. Some may use an (SQL) database, others flat files. Cacti uses RRDTool to store data.

RRD is the acronym for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, server load average). It stores the data in a very compact way that will not expand over time, and it can create beautiful graphs. This keeps storage requirements at bay.

Likewise, rrdtool will perform some specific tasks. It performs consolidation to combine raw data (a primary data point in rrdtool lingo) to consolidated data (a consolidated data point). This way, historical data is compressed to save space. rrdtool knows different consolidation functions: AVERAGE, MAXIMUM, MINIMUM and LAST.

Data Presentation

One of the most appreciated features of RRDTool is the built-in graphing function. This comes in useful when combining this with some commonly used webserver. Such, it is possible to access the graphs from merely any browser on any platform.

Graphing can be done in very different ways. It is possible, to graph one or many items in one graph. Autoscaling is supported and logarithmic y-axis as well. You may stack items onto another and print pretty legends denoting characteristics such as minimum, average, maximum and lots more.

Cacti

Cacti glues all this together. It is mainly written in php, a widely-used general-purpose scripting language that is especially suited for Web development and can be easily embedded into HTML.

Cacti provides the Poller and uses RRDTool for Storage and Graphing. All administrative information are stored in a MySQL database.

Cacti to RRDTool Translation Table

When using cacti, be it with or without current rrdtool knowledge, you may become confused by all those technical expressions. Let's try to translate

Cacti NotationRRDTool NotationUsage
Data Template structure of an rrd file Used to define the structure for storing data
This Template will be applied to specific hosts to create real RRD files
Data Source Item
as part of a Data Template
data source (ds) A RRD file may hold data for more than one single variable.<br>Each one is named “data source” in RRDTool lingo
Data Source
as a real instantiation of a Data Template when applied to a Device
RRD file Yep, this is an ugly one
When a Data Template is created, Cacti names it “Data Source”.
RRDTool says it's an RRD file
Graph Template structure of an rrdtool graph statement Used to create a “raw rrdtool graph statement”
This Template will be applied to specific hosts to create real RRD graphs
Graph Template Item
as a part of a Graph Template
graph element This is a complex one. Each item will create parts of an RRDTool graph statement. Typically, this will include
  • the (reference to the) DEF needed,
  • LINEx/AREA/STACK along with a color for graph elements or
  • GPRINTs for legends,
  • (reference to a ) CDEF and
  • textual elements
Graph
as a real RRDTool graph statement, created when applying a Data Template to a Device
RRDTool graph statement Whole statement, including all options and graph elements

You may be put off by all those template stuff. If you like a more practical approach, just skip to Why Templates?.

Graph Overview

Almost everything in Cacti is somehow related to a graph. At any time, you can list all available graphs by clicking on the Graph Management menu item. While it is possible to manually create graphs through this screen, new users should follow the instructions provided in the next chapter for creating new graphs in Cacti.

For users that are familiar with RRDTool , you will immediately recognize that a graph in Cacti is closely modeled after RRDTool's graphs. This makes sense since Cacti provides a user friendly interface to RRDTool without requiring users to understand how RRDTool works. With this in mind, every graph in Cacti has certain settings and at least one graph item associated with it. While graph settings define the overall properties of a graph, the graph items define the data that is to be represented on the graph. So the graph items define which data to display and how it should displayed, and also define what should be displayed on the legend.

Each graph and graph item has a set of parameters which control various aspects of the graph. Fortunately through the use of graph templates, it is not necessary to understand the function of each field to create graphs for your network. When you are ready to take on the task of creating your own graph templates, extensive field descriptions for both graphs and graph items are provided in that section of the manual.

At this point, you probably realize that graphing is Cacti's greatest strength. Cacti has many powerful features that provide complex graphing and data acquisition, some which have a slight learning curve. Do not let that stop you however, because graphing your network is incredibly simple.






Personal Tools