Metrics fast ‘n easy (?) with RRDTool and Ruby: Part 1: Installing RRDTool and ruby bindings on a Mac

I’m trying to set up a simple heads up display of key information about our running system as we move towards releasing our first product. This display is grouped into themes, each theme contains 1..N graphs of relevant system data.

As a manager this is not my full time job, so I didn’t to get into navel gazing mode wrt the  ‘ultimate’  stats monitoring system, especially since that wheel has already been invented. I settled on using RRDTool to display statistics, mainly because RRDTool has pretty advanced, robust ways to age data out, while keeping the database down to a finite size. It also generates PNG files, which I could update and throw up on a page as needed. There would be a need to track application specific metadata (like what each graph maps to), but no need to handle storing and retrieving metrics data, which gets me (and the poor bastard that inherits this tool) out of a world of pain.

It’s been years since I’ve set up RRDTool, and that was on a Red Hat system. Now I’m a Mac fanboy, and so here are my notes on how to set up RRDTool with Ruby binding on Mac OSX Tiger.

RRDTool can be installed via mac ports which makes pulling in the dependencies ‘not my problem’– the best kind of problem to have :):

sudo port install rrdtool

To build the ruby binding, you need to get the source from here. The ruby binding is in {src folder}/bindings/ruby. In order to get the generated Makefile to point to the installed rrd libs, you need to change the following line in extconf.rb:

dir_config("rrd","../../src","../../src/.libs")

to

dir_config("rrd","../../src","/opt/local/lib")

Then run

ruby extconf.rb

to generate the makefile, then

make

and

make install

to respectively build and then install the RRD.bundle to /opt/local/lib/ruby/site_ruby/1.8/i686-darwin8.9.1

To confirm that things have run successfully:

ruby test.rb should generate a test.png file.

Advertisements

3 Responses to Metrics fast ‘n easy (?) with RRDTool and Ruby: Part 1: Installing RRDTool and ruby bindings on a Mac

  1. […] Wherever I go, there I am sometimes that’s nice, sometimes not so much… About MeLife Todo list « Metrics fast ‘n easy (?) with RRDTool and Ruby: Part 1: Installing RRDTool and ruby bindings o… […]

  2. […] quantifiable value and let me focus on doing easy things of much greater value (see above goal). Using RRD is a good example of outsourcing a hard problem  — what to do with all that data ?!?– […]

  3. […] and averages As noted in other posts, I’m writing a monitoring application. Because this is at best a part time effort that needs to be done quickly, I’ve made some […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: