Uncategorized

MRTG Dashboard

I’m one of those die-hards whose been using MRTG for almost as long as I’ve had a computer with a network connection. It’s an old tool for monitoring network traffic and its not pretty by modern standards but it does still do that job very well. However, its blocky output does rather leave much to be desired in this day and age of interactivity and so I’ve knocked together an MRTG Dashboard.

It’s a single PHP script which you just pop in your MRTG output directory (workdir) on your PHP-enabled web server. That’s all you need, all the required libraries are loaded from CDNs. It’s not perfect, but it is an improvement.

MRTG Dashboard screenshot

MRTG Dashboard screenshot

You will find that the timescales on the interactive graphs can be a little hit-and-miss. This is because while Highcharts demands data at consistent intervals when creating time-based graphs MRTG’s data is anything but consistently intervalled. I will try to improve this at some point in the future.

You can get MRTG Dashboard from Github.

Uncategorized

Call centre HUD for Asterisk

At work every fortnight or so we hold what we call Evenings Of Code. The company buys the development team pizza and beer and in exchange we work on projects and ideas that are of special or particular interest to us, that the company would benefit from, but that the company doesn’t really need at the moment and so normal weekday work time cannot be allocated to it.

My recent project has been to create a HUD (Heads-Up Display) for the call centre. I’m particularly suited to do this out of those in my team because I have quite a lot of experience with Asterisk, the popular open-source PBX, on which the company’s telephone system is based. The system, designed for a 1080p display (it’s not yet decided whether we’re going to go for a plasma or a projector yet), uses caller details records (CDRs) and the Asterisk Manager system to gather statistics on the day’s calls. It’s not quite realtime, but the key queue statistics from the Manager are updated every five seconds and the cumulative statistics based on the CDRs since midnight every 20 seconds.

A script runs constantly in the background during the working day (8.00am to 8.00pm) to perform the updates, which saves the results in a database table. The HUD itself is then loaded in a browser and uses AJAX calls every five seconds to read the contents of this table. This will allow multiple instances of the HUD to run without each hammering the CDRs and the Manager. At the moment, as it’s in testing, it’s being loaded into web browsers by certain staff members, and so when it initially loads it loads quarter-size. When we finally put it up on the wall we would then hover over the top right corner and an option will appear to enlarge it to full 1080p, basically by doubling the values in key CSS properties.

It looks slick too. Because it uses AJAX there are no page loads, you would expect nothing less in this day and age. If a digit changes after retrieving an update then the old digit is faded out before the new digit is faded in. If a digit doesn’t change between updates it obviously remains static.

We’re now trying to ascertain whether my algorithms for calculating the statistics are accurate at the moment by using a bit of manual record keeping on the part of the cell centre staff, who have been asked to record the number of calls they are taking per day for a week or so, independently of the records on the PBX. I’m confident that I’ve got it right, however, and actually quite pleased the information that I have been able to calculate given that Asterisk CDRs aren’t all that great to work with.

Assuming the project gets full approval following testing my intention is to get it running on a Raspberry Pi, which can be strapped to the back of the screen or on top of the projector, or indeed easily hidden in the ceiling in either case. Given that modern screens and projectors come with USB ports they will even be able to supply power to the Raspberry Pi. This means that the screen or the projector, whichever is chosen, represents the largest cost of the project as the Raspberry Pi eliminates the need to dedicate a whole PC for the purpose. My research indicates that the Raspberry Pi is capable of running Google Chrome, so that’s all good.

Screenshot of the system during a quiet period (no calls in the queues)

Uncategorized

Cadburys Olympic Podium Clock

I worked on a couple of extra-curricular projects over Christmas, one being a a project for Cadburys, who are touring the country over the next six months before the Olympic Games with three podium-style stands on which punters can attempt to win one of ten pairs of tickets to the opening ceremony by estimating how long exactly 20.12 seconds is. These will appear in various shopping centres and exhibitions over the months.

Punters press the big red comedy button to start and press it again to stop, and no, they don’t have view of the screen while they’re playing. If they win there’s a winning sequence of sounds and words on the display and the operator also activates four flashing purple police lights. It’s pretty much impossible to estimate correctly, however, even if you do have sight of the screen.

My job was to create the software for this including all the graphics, which I did using my normal skill-set of HTML, CSS and Javascript/jQuery (no server-side stuff required, runs on a laptop without an Internet connection). I’m also able to push out software updates to each of the three stands over the next six months should they for some reason become necessary.

The screens in the photo below will be installed within the podium-style stands themselves and only the clock digits themselves will be visible through the aperture in the front (simulated by the crude paper surround on the screen on the right). The purple bar at the top of the screens is only visible on the operator’s laptop and contains some basic options and settings which aren’t publicly visible. The red button is custom built and contains a USB numeric keypad with a mechanism that presses the “5” key. This then simply plugs into the laptop as a USB keyboard.

It was a nice bit of fun. It’s not a million miles away from the sort of things I used to do when I worked for 2Heads back in 2000/2001, so almost a little nostalgic. No plugins or flash either, all HTML5, CSS3 and jQuery, as it should be.

Testing the displays and the comedy red button

In action in the Birmingham Bullring during March 2012