[rrd-users] setting last_update

Dan Langille dan at langille.org
Thu Feb 15 15:18:05 CET 2007


On 15 Feb 2007 at 15:06, Alex van den Bogaerdt wrote:

> On Thu, Feb 15, 2007 at 08:11:06AM -0500, Dan Langille wrote:
> > My short term goal is to reset last_update in an rrd file.  Long 
> > term, I'd like to find the cause of the very large value contained 
> > therein.
> > 
> > The problem occurs on a system running FreeBSD 6.2 with an amd64 
> > kernel.
> 
> Hmmm...  64-bit.  You may very well have found a bug.  Not necessarily
> in RRDtool, perhaps a library or so.

FWIW, here is a test case I created by looking at what the symon code 
was doing:

rrdtool create cpu0.rrd --step=5 --start=0 DS:user:GAUGE:5:0:100 
DS:nice:GAUGE:5:0:100 DS:system:GAUGE:5:0:100 
DS:interrupt:GAUGE:5:0:100 DS:idle:GAUGE:5:0:100 
RRA:AVERAGE:0.5:1:34560 RRA:AVERAGE:0.5:360:672 
RRA:AVERAGE:0.5:1440:600 RRA:AVERAGE:0.5:17280:600 
RRA:MAX:0.5:1:34560 RRA:MAX:0.5:360:672 RRA:MAX:0.5:1440:600 
RRA:MAX:0.5:17280:600 RRA:MIN:0.5:1:34560 RRA:MIN:0.5:360:672 
RRA:MIN:0.5:1440:600 RRA:MIN:0.5:17280:600

rrdtool info  cpu0.rrd | head
filename = "cpu0.rrd"
rrd_version = "0003"
step = 5
last_update = 944503488000

See also http://pastebin.ca/357134


> > I encountered these errors yesterday:
> > 
> > rrd_update:illegal attempt to update using time 1171508010 when last 
> > update time is 94450340160
> > 
> > The first date looks OK. The second does not.
> 
> Indeed.
> 
> > Looking at the rrd file:
> > 
> > # rrdtool info  cpu0.rrd | head
> > filename = "cpu0.rrd"
> > rrd_version = "0003"
> > step = 5
> > last_update = 944503401600
> > 
> > 
> > Notice the date, that's a bit odd:
> > 
> > # date -r 944503401600
> > Wed Feb 14 00:00:00 PST 31900
> 
> Using GNU date:
> $ date -u -d 19700101\ 00:00\ 94450340160\ seconds
> Mon Oct  7 07:14:08 UTC 1968
> 
> 
> I'm not saying that this is more correct, I'm just noticing a difference.
> 
> [snip: good on i386]
> 
> 
> > Failing a solution, does anyone know how to reset the last_update 
> > field in an rrd file?
> 
> you could try a dump-restore cycle.  But I would pay much attention
> to the rest of the file as well.
> 
> $ rrdtool dump my.rrd|head -7
> <!-- Round Robin Database Dump -->
> <rrd>
>         <version> 0003 </version>
>         <step> 60 </step> <!-- Seconds -->
>         <lastupdate> 1171548181 </lastupdate> <!-- 2007-02-15 15:03:01 CET -->
> 
>         <ds>

What I get, using my example creation above, is:

 # rrdtool dump cpu0.rrd | head -7
<!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
        <step> 5 </step> <!-- Seconds -->
        <lastupdate> 944503488000 </lastupdate> <!-- 31900-02-15 
00:00:00 PST -->

        <ds>
                <name> user </name>
                <type> GAUGE </type>

I didn't supply the whole dump as it is 109,870 lines....

The last date is 31900-02-14 16:00:00 PST / -38934592 and the first 
date is 31900-02-13 00:00:05 PST / -38948991

> 
> 
> HTH
> -- 
> Alex van den Bogaerdt
> http://www.vandenbogaerdt.nl/rrdtool/
> 
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
> 



-- 
Dan Langille : Software Developer looking for work
my resume: http://www.freebsddiary.org/dan_langille.php
PGCon - The PostgreSQL Conference - http://www.pgcon.org/




More information about the rrd-users mailing list