[rrd-users] setting last_update

Alex van den Bogaerdt alex at ergens.op.het.net
Fri Feb 16 04:24:28 CET 2007


On Thu, Feb 15, 2007 at 11:27:52AM -0500, Dan Langille wrote:

> > Try adding "--start=0".  Perhaps it isn't as harmless as it looks.
> 
> Well, you are correct:
> 
> [dan at supernews:~/tmp] $ rm test.rrd
> [dan at supernews:~/tmp] $ rrdtool create test.rrd --start=0 
> DS:x:GAUGE:600:U:U RRA:AVERAGE:0:1:5
> [dan at supernews:~/tmp] $ rrdtool dump test.rrd  | head
> <!-- Round Robin Database Dump --><rrd> <version> 0003 </version>
>         <step> 300 </step> <!-- Seconds -->
>         <lastupdate> 944503488000 </lastupdate> <!-- 31900-02-15 
> 00:00:00 PST -->


I don't know what exactly is going wrong, and why it does not go wrong
on 32-bit systems, but the following patch seems to fix the problem.

I currently have no source unzipped, could someone on 32-bit please
verify that my patch does not break rrdtool ?


--- rrdtool-1.2.19/src/parsetime.c.orig	Thu Feb 15 22:15:36 2007
+++ rrdtool-1.2.19/src/parsetime.c	Thu Feb 15 22:16:57 2007
@@ -850,7 +850,7 @@
 	      if ( ptv->tm.tm_hour == 30 ){
 		ptv->tm.tm_hour = hour_sv;
               }
-	      if ( ptv->tm.tm_hour == 30000 ){
+	      if ( ptv->tm.tm_year == 30000 ){
 		ptv->tm.tm_year = year_sv;
               }
 	    };	    


Thanks in advance.
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list