[rrd-users] Re: Q about copying an existing rrd database and zeroing out the data

Bill Benedetto bbenedetto at goodyear.com
Wed Feb 16 23:08:04 MET 2005

>>> Tobias Oetiker writes:

  Tobi> use rrdtool info this will tell you the structure in an efficient
  Tobi> way, use this information to creat the new rrdfiles ... you can
  Tobi> call info through the perl interface ...

Sorry but this just isn't crystal clear to me.

If I call RRDs::info, I get a hash that looks like this:
  ds[Ping].last_ds = UNKN
  ds[Ping].min = 0
  ds[Ping].minimal_heartbeat = 900
  ds[Ping].type = GAUGE
  ds[Ping].unknown_sec = 0
  ds[Ping].value = 0.04444
  filename = /usr/local/nagios/rrd/tpcmweb-PING.rrd
  last_update = 1108591004
  rra[0].cdp_prep[0].unknown_datapoints = 0
  rra[0].cf = AVERAGE
  rra[0].pdp_per_row = 1
  rra[0].rows = 50400
  rra[0].xff = 0.5
  rra[1].cdp_prep[0].unknown_datapoints = 0
  rra[1].cdp_prep[0].value = 0.0299737333333333
  rra[1].cf = AVERAGE
  rra[1].pdp_per_row = 60
  rra[1].rows = 43800
  rra[1].xff = 0.5
  rrd_version = 0001
  step = 60

This, of course, is in a hash that I retrieved like this:
  my $hash = RRDs::info $oldrrd;

But but I don't see how to get from that $hash to what I think I
need for RRDs::create - namely an array of something like this
"DS:NAME_HERE:GAUGE:600:0:U" (for example) and an array something
like this: "RRA:AVERAGE:0.5:1:576 RRA:AVERAGE:0.5:6:576
RRA:AVERAGE:0.5:24:576 RRA:AVERAGE:0.5:288:576" (for another

All the examples that I see of RRDs::create look like this:
  RRDs::create($newrrd, @ds, @rras);
where @ds and @rras look something like what I showed in the last

Is there some easy way to get from the RRDs::info hash to what I
need for RRDs::create?

Sorry if this is brain-dead easy and I just don't see it.

Thanks for any light you can shed on this!

- Bill
Bill Benedetto     <bbenedetto at goodyear.com>    The Goodyear Tire & Rubber Co.
I don't speak for Goodyear and they don't speak for me.  We're both happy.

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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list