Tutorials Category

Cacti: Using Cacti to monitor web page loading - Part 3

Friday, September 19th, 2008

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.

(more…)

Cacti: Using Cacti to monitor web page loading - Part 2

Friday, September 19th, 2008

In Part 1, I discussed about how to use Cacti, a great open-source monitoring tool, for the purpose of monitoring your webpages. More specifically, the time it takes for a webserver to receive the request to the point where the last byte is sent out. I walked through the custom scripts needed by Cacti and how to test that the scripts are working.

In this post, I’m going to cover how to configure Cacti to use the custom scripts I posted in Part 1 and start collecting data for your webpages. In Part 3, I will touch on how to start graphing with the data collected.

So without further delay, let’s get started!

(more…)

Cacti: Using Cacti to monitor web page loading - Part 1

Wednesday, September 17th, 2008

In my current project, I’ve been looking into website performance and measuring how long it takes for webpages to be composed. Although there are plenty of tools both commercial and non-commercial which is available to do just that, they either cost too much or is a one-time data capture tool (which would be quite laborious if we have to constantly trigger it every 5 mins manually).

Instead I investigated on Cacti to see if this commonly used tool by Network/System Admin folks for monitoring network devices and systems can be reworked to let me monitor webpage loading time.

And it did wonderfully…
(more…)

Cacti: Ubuntu 8.04 Cacti Plugin - Invalid PHP_SELF Path problem

Thursday, August 14th, 2008

Cacti Ubuntu problemLately, I’ve been spending a lot of time with Cacti on my Ubunto 8 install. Cacti as we all know is a (great) PHP wrapper application around the rrdtool command. Cacti and rrdtool are typically used by network/systems administrators for graphing network conditions, churning out great looking graphs for various SNMP data.

I’ve been investigating whether I could use Cacti to graph other kinds of data like my website loading time etc. And, it does, brilliantly, but that’s another story for another day.

In any case, after getting Cacti running smoothly on Ubuntu, I decided to try the Cacti Plugin Architecture to see if I could learn how to build some plugins for Cacti. And it wasn’t so straightforward.
(more…)

PHP Class for Date Time calculations - Part 2

Monday, July 21st, 2008

In my previous posting I touched on a PHP class called DateClass (by Steve Powell) that I downloaded from phpclasses.org. The DateClass package actually contained 2 separate classes. One for manipulating dates and the other for date spans.

This post will cover how to use the DateSpanClass to easily calculate the difference between 2 dates, in intervals from seconds to years. Sadly, however, the class have some bugs which needs to be fixed before it can be used.

(more…)

PHP Class for Date Time calculations - Part 1

Monday, July 14th, 2008

Performing data/time calculation is basic requirement in any programming project. No serious application can hide from it, so thankfully PHP itself comes with some very useful data/time functions. But, I feel that those PHP date/time functions are probably great for data/time display and formatting, but not so much for calculating for things like the beginning/end of the week, the number of seconds between two dates etc.

Again thankfully, after a visit to phpclasses.org, I found a nifty little class written by Steve Powell (way back in 2004) called DateClass which did what I wanted. Unfortunately, the documentation was only a class reference sheet, and doesn’t come with any examples to quickly get things going.

(more…)

A look at the Google Graph class

Tuesday, June 3rd, 2008

In my previous post about creating simple graphs using Google Charts API, I mentioned about a PHP class, called Google Graph, which Ryon Sherman wrote that encapsulates this API, making it easier to code in PHP.

I incorporated this class in my CakePHP project, and found that there were a couple of problems with it.

(more…)

CakePHP: Using scaffolding for rapid application building

Tuesday, May 20th, 2008

ScaffoldingThat’s right, I’m still on my CakePHP journey. I’ve been spending quite a bit of time now trying to match what I want to build with how to go about doing it in CakePHP. We all know that the blog example is pretty simplistic - a real world app won’t be quite so straightforward. At the moment, I’m trying to build up an intranet of sorts, with lots of different independant apps, and it’s driving me crazy… How would I structure the it? Should I use ‘plugins’? The folders, the views etc. Yes, it’s all still a big mess.

In any case, I found that CakePHP has a really nifty feature that really helps with sorting out the mess, and it’s called “scaffolding”.

(more…)

CakePHP: Working with ‘Associations’

Thursday, May 8th, 2008

This is probably going to be the first of many postings of my exploration with CakePHP. This post will briefly look at the CakePHP’s ‘Associations’ feature. Associations is “the relational mapping provided by the [CakePHP] model”.

In non-Cake speak, we’re talking about standard SQL joins - the mapping of relations between SQL tables. As you may know, doing SQL joins can be quite messy with unwieldy SQL strings. Thankfully, CakePHP provides a very simple way of joining tables.

(more…)

Creating simple graphs using Google Charts API

Thursday, April 24th, 2008

Thinking back a fews years ago, I was involved in building some reporting modules with graphs and charts to show our customer utilisation of our data center. After trying a number of different open source graphing packages for PHP, I finally found JpGraph, which I daresay is probably the best graphing package available for PHP. (In my experience anyway.)

However, JpGraph requires other dependencies like GD libs - the kind of thing which we may not always have control over if we host with web hosting providers. Thankfully, there’s now a simple and easy way of building simple good looking graphs with just an <img> tag.

(more…)

Google