Welcome to Part 3 on using Cacti for monitoring of web page loading time. In the previous 2 parts, I walked you through how to install a custom script which will query for the loading time of a web page (Part 1), and how to configure Cacti to start collecting data (Part 2).

In this, and final part, I will cover how to start graphing your data collected within Cacti.

A quick recap
At this stage you should have created a Data Input Method (Step 1):

cacti screencap 1

And, you should have created a Data Source (Step 2):

cacti screencap 2

You should also have left Cacti a bit of time to collect the data so that you have some data points you can use to draw your graph.

Step 3: Creating a Graph
From the menu, choose Graph Management and click ‘Add’ to create a new graph.

cacti screencap 3

At the Graph Template Selection webform, just leave both as ‘None’ and click the ‘Create’ button. You’ll be show a new webform called Graph Configuration. You can pretty much leave all the configuration setting as it is, except the Title field. Just key in a name for this graph you can recognize. Once done, go to the bottom of the page and click ‘Create’.

cacti screencap 4

A new Graph Items table will appear where you can define what will appear in the graph.

cacti screencap 5

Click the ‘Add’ button on the top-right of this table. At this form, you can define which parameter you want to plot onto the graph.

cacti screencap 6

For this example, choose the ‘ttl’ parameter as the data source to plot into the graph. Pick yourself a color to use, and choose the ‘Area’ option to plot an area graph. (You can of course choose to use line graph, or stack graph etc – I’ll leave you to play with it once you get the basics). Lastly, give a title to this plot at the Text Format field.

Once done, click ‘Save’ and you should have a graph showing up (hopefully) as so:

cacti screencap 7

And that’s it! The only thing left now is to get your graph included into the Graph Tree so that it will appear in Cacti’s Graphs tab.

Improving your graphs
If you want, you can go back to Graph Management, and improve your graph with other plots and legends etc. Just keep adding Graph Items for your graph and maybe create a graph such as this:

cacti screencap 8

How to read the graph?
If you look at my graph above, there are a few useful pieces of information you can derive from this.

  1. It takes on average 391.2ms to complete the whole transaction, from receiving a request for my blog’s homepage until receiving the last byte.
  2. If I subtract 234.1ms (start transfer) from 391.2ms (total time), I will get 157.1ms, which is the time it takes for the monitoring agent to receive the webpage data. Of course if your monitor is logically far away from your webserver, this number will be larger.
  3. If I subtract 64.67ms from 234.1ms, I will get 169.43ms. This tells me on average it take 169.43ms for wordpress (which is my ‘CMS’) to compose and build my page.

Although I didn’t plot the ‘spd’ parameter, this parameter would be quite useful if you want to monitor the transfer rate between the monitor location and your website hosting location. Plotting this will give you a sense of whether your bandwidth is congested at any point in time. (I’m sure you can get that from monitoring your network device bandwidth too).

There are other things you can do too, like create CDEFs, your own Data, Host, Graph templates to make it easier to create more data sources and graphs. But I’m leaving that for another day.

That’s all folks!
Well, that bring me to the end of this long 3 part tutorial. Thanks for your patience and please feel free to leave comments or questions. Hopefully, this article has been of use to someone.

Part 1 | Part 2 | Part 3