Cacti (home)ForumsRepositoryDocumentation

My first Data Template

For this task, let's stick to SNMP stuff. For you to be able to reproduce this example, I've chosen the UDP information of the IP MIB.

Code:
snmpwalk -c <community string> -v1 <device> udp
UDP-MIB::udpInDatagrams.0 = Counter32: 7675
UDP-MIB::udpNoPorts.0 = Counter32: 128
UDP-MIB::udpInErrors.0 = Counter32: 0
UDP-MIB::udpOutDatagrams.0 = Counter32: 8406
... more to follow ...

As cacti does not use the MIBs but pure ASN.1 OIDs, let's search the OID used as udpInDatagrams:

Code:
snmpwalk -c <community string> -v1 -On <device> udp
.1.3.6.1.2.1.7.1.0 = Counter32: 7778
.1.3.6.1.2.1.7.2.0 = Counter32: 129
.1.3.6.1.2.1.7.3.0 = Counter32: 0
.1.3.6.1.2.1.7.4.0 = Counter32: 8514
... more to follow ...

The needed OID is .1.3.6.1.2.1.7.1.0. Now learn how to enter this into a new Cacti Data Template:
Please proceed to Data Templates and filter for SNMP. Check the SNMP - Generic OID Template

Data Template
 

After clicking Go, you're prompted with a new page to enter the name for the new Data Template:

Data Template Copy
 

Due to the filter defined above, you won't see the new Template at once, so please enter udp as a new filter to find:

Data Template New Filter
 

Now select this entry to change some definitions according to the following images:

Data Template New 1
 

for the upper half of the page and

Data Template New 2
 

for the lower one. Please pay attention to change the MAXIMUM value to 0 to prevent data suppression for values exceeding 100. And you saw the OID .1.3.6.1.2.1.7.1.0 from above, didn't you? Please copy another one for OID .1.3.6.1.2.1.7.4.0, using the description udpOutDatagrams

Name
The Title of the Data Source will be derived from this. If Use Per-Data Source Value (Ignore this Value) is unchecked, the string entered here is take literally. Checking this box allows for target-specific values by substituting cacti's built-in variables (|host_description| will be substituted by the description of the host this Data Template will be associated with.)
Data Input Method
This selection box allows to associated this Data Template with a specific Data Input Method and the output variables defined therein. For SNMP data use the predefined method Get SNMP Data
Associated RRA's
RRA's define how to store retrieved data and how to consolidate them. Find more about this topic in the rrdtool related sections. This example is built with the predefined settings for RRA's
Step
Defines the inteval size in seconds between to polling requests. Default is 300 seconds.
Data Source Active
You may deactivate the Data Source here, e.g. to prevent using it
Internal Data Source Name
Each Data Source (there may be more than one per rrd file) has its own name. It is used to access the data. Therefor, it is wise to choose some "self-explanatory" name. For SNMP data, I'd prefer to take the string representation of the OID (if it is not too long)
Minimum Value
When updating the data source, rrdtool will skip all values that are lower than this Minimum Value. Using negative values requires this to be changed.
Maximum Value
When updating the data source, rrdtool will skip all values that are higher than this Maximum Value. Pay Attention! When creating a new data source, this value defaults to 100. This is not always a good choice. Entering 0 will result in "no Maximum Value"
Data Source Type
This defines, how rrdtool handles data. While snmpwalking e.g. UDP OIDs, you will notice, that all data are associated with some type. Most important are:

COUNTER
Data representation that counts all occurences (e.g. udpInDatagrams) since SNMP agents start time. Can be compared to the mileage of a car. So this value will always increase. It will decrease only, if the SNMP agent is restarted. To get the data of the last interval, rrdtool will build the difference between two data points
GAUGE
Data representation that always shows the actual value. Can be compared to the actual speed of a car.
Heartbeat
If rrd's are not updated within Heartbeat's seconds, the needed data point is assumed to be NaN ("not a number = no valid data)
OID
Numerical representation of the OID that will be used for querying the target to retrieve data

That's all, for now.