Customizing Cacti Graphs

Axigen Documentation

In the previous article, we learned how to use the default options available in Cacti, now we will learn how to tweak different settings that allow us to further understand how Cacti and the RRDTool function.

First we used the generic templates, now we will learn how to create and customize templates.The first step is to create a duplicate of the above used generic template and then further customize it as necessary. This step is required only to preserve the default templates and to not alter Cacti's data:

  • Click the "Graph Templates" link under the Templates section;
  • Select the "SNMP - Generic OID" template;
  • Select the "Duplicate" option from the drop-down menu in the lower right corner of the screen and click on the "Go" button.
  • Type "Axigen graph template" in the "Title Format" field and click on the "Yes" button to create a duplicate template of the "SNMP - Generic OID" template.

The customization steps described below require the creation of additional graphs based on the customized template; until new graphs using the modified template are created the current ones will look the same since they are based on the generic template.

The first customization consists in a display adjustment since, as you may notice, the graph created using the generic template displays the legend on the same line with the current, average and maximum values reached. This causes the maximum value to do not fit the graph and thus cause the absence of this value.

Let's proceed:

  • After creating the duplicate template, the list of templates will also display this freshly created template;
  • Click on the template previously created to display its options;
  • In the "Graph" item list, click on the first item;
  • Check the "Insert Hard Return" box and click on the "Save" button;
  • Click the "Save" button found at the bottom right of the page to save the now modified custom template;
  • Resolve any errors that may appear. In our our tests, the Lower limit value had not been set, but specifying the value 0 fixed the error message.

To see the results, you must create a graph by following the steps mentioned above in the article, only that, this time, you will reference the modified template instead of the generic one. After creating your graph, you must wait for Cacti to poll data (also included in the graph) and see the differences between the graphs.

You will notice that although being displayed, the graph does not contain any data. This is caused by the fact that the graph is created at the polling interval and you will need to wait for the next polling (5 minutes) in order to actually see any data being graphed.

The next customization is also related to the way a graph is displayed. As you may notice, the graph created using the generic template also exhibits a display peculiarity. The number values do not correspond with the actual data. This is caused by the fact that Cacti is designed to work with average values, meaning that the displayed values are averages of the actual data reported by Axigen. This averages are made by comparing the previous value of the graph with the new provided from Axigen.

With the exception of the current and maximum values displaying the value read when data was polled and the maximum value ever recorded, all the values displayed, including the graph, are average values.

Besides the number values, there is another artifact caused by the generic orientation of Cacti to network devices; its data is, in many cases, represented by a decimal number and a multiple (b, B, k, m, g, t) which is used to represent the multiple or sub-multiple of a bit value (e.g. value of bits transferred or gigabytes downloaded).

As you will often need a decimal value that does not represent bits and you will not want to be bothered by the attached letter of the multiple computed by Cacti, here are the steps to configure the newly-created custom template so as to display the decimal value only:

  • Navigate to the graph templates section as previously described;
  • Open the custom template;
  • Click on the first item in the graph item list;
  • For the "CDEF Function" value, select the "Make Per 5 Minutes" setting;
  • For the "GPRINT Type" value, select "Load average setting for decimal values with two decimal places" or "Exact numbers setting for integer decimal values";
  • Click on the "Save" button and repeat the same step for all the graph items before saving the graph template.