[rrd-users] (perl) RRDs::last not lasting via RRDs::update

Bruce Campbell bruce.campbell at apnic.net
Tue May 16 08:59:51 MEST 2000


Currently I'm attempting to write a 'lazy' update script for importing
both historical data, and data collected in the recent interval, into an

As a simple solution, I'm calling RRDs::update with:

	$querytime = RRDs::last $rrdfile;
        if( $querytime < $known_start_time_of_data ){
		$querytime = $known_start_time_of_data;
	while( $querytime <= time ){
		$valuestring = &getdata( $querytime, $thesekeys );
		RRDs::update $rrdfile, "-t $thesekeys", 
		$querytime += $step;

( Repeat for all datasources referenced in $thiskey ).

However, every time the script is run, it starts again from the start of
the known data as the value returned from RRDs::last is 0.  This is mildly
annoying ;)

Running rrdtool from the commandline to enter in data manually, eg:

	$ rrdtool update filename.rrd N:1:2:3:...

does actually set the RRDs::last variable.

Am I correct in assuming that the last_update variable SHOULD be set by
RRDs::update in the manner described above, and that RRDs::last SHOULD be
returning the last timestamp given to RRDs::update ?

( Note to Tobias, this is both with and without the patch that I sent you )

  Bruce.                                                 | Cynical Bastard
  A Gentlemen is someone capable of singing more than    |       Sysadmin,
  one part in the same piece, but doesn't.               |           APNIC

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

More information about the rrd-users mailing list