[rrd-users] Once a day updates incorrect by timezone

Tobias Oetiker tobi at oetiker.ch
Fri Aug 20 07:41:29 CEST 2010


Hi Brett,


Today Brett Wilson wrote:

> Hi All,
>
> Im monitoring my solar power installation and logging it into rrdtool then
> graphing the output.
> *http://powermonitoring.zzl.org/*
>
> Its all working well apart from the daily updates which run at midnight each
> night (local time) and pull the KwH produced today and the Time online today
> from the inverter. The bottom graph from the webpage is the one im talking
> about.
>
> My rrd database is setup as follows:-
> --start N
> -s 86400
> DS:KWH_Today:GAUGE:86500:U:U
> DS:INV_Online:GAUGE:86500:U:U
> RRA:AVERAGE:0.5:1:365
>
> Then im updating as follows at 23:59 local time (GMT +10):-
> rrdtool update Xantrex_Daily_Totals.rrd N:somenumber:somenumber
>
> >From what I have found In the forums I need to replace the N with something
> else for the timestamp to ensure that its put in for the correct day however
> am unsure what to put in.
>
> Any help would be appreciated.

rrdtool times are UTC aligned, if your location is 10h away the
rrdtool days will be shifted 10h vs your local time ... the
simplest way arround this, is to run your rrdtool copy in UTC mode.

use put a

TZ=GMT

in front of every rrdtool command or set the environment variable
in your script ... (that is for ALL rrdtool invocations ... create,
update, graph ... everything !) and you will have to play with the
timestamps a bit when putting data into rrdtool ...

then rrdtool will seemingly operate in local-time, the only odd bit
will be the times when daylight saving time starts and stops ...

cheers
tobi

> Cheers
> Brett
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900



More information about the rrd-users mailing list