[rrd-users] rubyrrdtool 0.5.0

Mark Probert probertm at acm.org
Thu Aug 4 18:05:53 MEST 2005

Hi ..

I am pleased to announce the initial release of rubyrrdtool, a Ruby
extension / binding supporting RRDtool 1.2.x.  

The release can be found at RubyForge (thanks, Tom):


This release (0.5.0) should be considered alpha.  Documentation is
scarce, though I have added RDoc code into the extension.  The extension
works, though it is missing a nice class wrapper and a definitive test
suite.  A beta version should be out in the next few weeks.

This project is an update on earlier work done by Miles Egan, and
extends and enhances the code to support all of the RRDtool extended
commands, such as rrd_fetch(), rrd_xport() and rrd_info().  Internally,
it makes use of the newer thread-safe calls included in libRRDtool.

There are a number of examples to be found in the play/ directory.

As a warning, I haven't tested any of this code against a 1.1 release of
RRDtool.  My guess is that it will fail dismally as it uses the
thread-safe versions of the function calls whenever it can.  I believe
that these are only in 1.2+.  For earlier releases, using Miles original
interface code would be my suggested work-around.

As a sampler, the minmax example in Ruby looks like 

#!/usr/bin/env ruby
require "RRDtool"

name    = "minmax"
rrdname = "#{name}.rrd"
start   = Time.now.to_i

rrd = RRDtool.new(rrdname)
puts "created new RRD database -> #{rrd.rrdname}"
puts "RRDTool library vers -> #{rrd.version}"

# ---------------------------------------------
#           Create
# ---------------------------------------------
puts " .. creating #{rrdname}"
n = rrd.create(
      300, start-1,

# ---------------------------------------------
#           Update
# ---------------------------------------------
puts " .. updating #{rrdname}"
val = start.to_i
while (val < (start.to_i+300*300)) do
    rrd.update("ds_0", ["#{val}:#{Math.sin(val / 3000) * 50 + 50}"])
    val += 300

# ---------------------------------------------
#           Graph
# ---------------------------------------------
puts "generating graph #{name}.png"
    "--title", " #{name} Demo",
    "--start", "now",
    "--end", "start+1d",
    "--imgformat", "PNG",


-mark.  (probertm at acm dot org)

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list