[rrd-users] Re: Importing data from ascii files - A solution

Wilks Jonathan-BJW002 J.Wilks at motorola.com
Mon Oct 29 17:25:04 MET 2001


I've cracked it but I had to cheat.  This solution assumes you have an ascii file consisting with your values to enter in the format unixdate:value on each line e.g.

1004009400:15
1004009700:14
1004010000:13

This MUST be in data order with the oldest date first.

1.  Create your rrd file

2.  run rrdtool dump on the above file and save the output to a file
	rrdtool dump test.rrd > test.xml

3.  Edit the test.xml file and between the <lastupdate> tags enter the earliest datetime value of your input data.
	<lastupdate> 996019000 </lastupdate>

4.  Restore this xml file thus
	rrdtool retore test.xml test.rrd

5.  Enter the data in the input file.  You could do this in a loop thus;
	for i in `cat input.txt`
	do
	rrdtool update $i
	done

It's dirty but it has worked for me.

All the best.

Jon Wilks.


-----Original Message-----
From: Torleiv Flatebo Ringer [mailto:ringert at consumption.net]
Sent: 29 October 2001 12:14
To: Wilks Jonathan-BJW002
Cc: rrd-users at list.ee.ethz.ch
Subject: Re: [rrd-users] Re: Importing data from ascii files.


I had the same problem last night, and my theory was shot, as I had the same
error message.

What you can do is 'rrdtool dump file.rrd > file.dump' then edit the 
resulting xml file, and then use rrdtool to import the data back
into the rrd file. Works great.

You could easily make a program to insert the values for you since it 
is in xml.

torleiv

what you said

> 
> Trouble is, I tried that and I get the following message;
> 
> $ /usr/local/rrdtool/bin/rrdtool update testccase.rrd "996019200:7"
> ERROR: illegal attempt to update using time 996019200 when last update time is 1004355231 (minimum one second step)
> 
> Jon.
> 
> -----Original Message-----
> From: Torleiv Flatebo Ringer [mailto:ringert at consumption.net]
> Sent: 26 October 2001 19:04
> To: Wilks Jonathan-BJW002
> Cc: rrd-users at list.ee.ethz.ch
> Subject: Re: [rrd-users] Importing data from ascii files.
> 
> 
> Should be easy to do, just add data at the right time stamps. Create an
> rrd file that spans the right time period (two years for example). You should
> then be able to "update" the rrd file with the "old" timestamps.
> 
> If you want to keep the data around forever, then you need to be careful
> about making sure that the "round robin" doesn't end before you want
> it to (make sure that your rrd file is big or long enough).
> 
> torleiv
> 
> what you said
> 
> > 
> > Does anyone know if it is possible to add archive data to an rdd file?  I monitor license usage data with rrd and I have some legacy data in ascii files that I would like to add.
> > 
> > Regards.
> > 
> > Jon Wilks
> > 
> > --
> > 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
> > 
> 
> 

-- 
second gear, redline, bliss

--
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