[rrd-users] Re: Local time zone

Robert Heber rheber at nawias.pl
Sun Nov 23 15:16:43 MET 2003


Użytkownik Alex van den Bogaerdt napisał:
> So this means according to the database, "now" is one hour
> ahead of the last update. 
Yes, that's right.

 > Verify this using " rrdtool info " and " perl -e 'print time' "
perl -e 'print time' values is about 3600 greater
than last_update value from rrdtool info,

> Perhaps the updating process doesn't work as desired.  
I'm sure about it. This process is named "flowscan"
and it fills my rrdfiles with wrong values.

> If you (meaning: your front end) delivers the current time as UTC time
> and RRDtool "thinks" it is local time, the translation will occur
> twice:
> Now:  23:08
> minus one hour to change from MET to UTC:  22:08
> RRDtool hears 22:08
> minus one hour to change from MET to UTC:  21:08
> Resulting time stamp for RRDtool: 21:08.
This is too complicated to me to accept. I've checked that time
"from the router which is used as time source for ntp, and which produce
data which I want to transform to the rrdfiles, and then the graphs",
and this time is good according to the local time. So the input data
have good time. Then is the flowscan who backs time about one hour,
so rrdfiles have wrong data inside and graph time is also the same as
local time, so without tricks with TZ variable "now" at the right edge
is "now" in local time, and the last updated data is about one hour

> Similar results can happen if RRDtool "thinks" it is still summer
> time (due to a wrong timezone setting):
> Now:  23:08
> RRDtool hears 23:08
> minus two hours to change from METDST to UTC: 21:08
.... and indeed this was caused be time change from summer to winter
at last sunday of october, but I think that everything (routers, local
time at server: cron time, shell time, rrd time, graph time is set to
the local. Only one element - "flowscan" which fills the rrdfiles still
"thinks" that there is still summer... I do not know what part of its
code is responsible for that.

> At graph time, the correct timezone is used and when you specify
> "--end 23:08 --start end-12h", RRDtool will translate this into
> "from 10:08 UTC to 22:08 UTC". Since the last update occured at
> 21:08 UTC, the last hour is unknown.
This might be the true and explanation, but I do not get why rrdtool
have to translate this time from local to UTC. Secondly this case could
be fixed with approbiate change --start --end parameters and TZ variable
to cut out what should be graphed and number hour axis in good way, but
this is hard to accomplish with every graph one by one - I think that 
better is to fix input data in rrdfiles (flowscan work) to change it
to the correct time.

> Search for differences in your environment when a job is started
> from cron vs. an interactive prompt.  I bet you'll find a difference.
There is no difference -

perl -e 'use POSIX;print asctime(localtime);print asctime(gmtime);'
invoked from crontab:
Sun Nov 23 14:28:01 2003
Sun Nov 23 13:28:01 2003

and invoked from shell:
Sun Nov 23 14:31:10 2003
Sun Nov 23 13:31:10 2003

> Alex

Best regards,

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