[rrd-users] xport and time zones
Sijs, Dick van der - Acision
dick.van.der.sijs at acision.com
Wed Oct 29 13:10:57 CET 2008
I have also tried introducing an offset as follows:
end time == int(t/86400)*86400 + "time zone offset",
start time == end time - 864000,
resolution == 86400
So I use the following arguments:
1224313200 = 2008-10-18 07:00 GMT = --start time
1225177200 = 2008-10-28 07:00 GMT = --end time
1225177200 - 1224313200 = 864000
And that gives *still* the result where the period boundaries are on 00:00 GMT:
$ rrdtool xport --step 86400 --start 1224313200 --end 1225177200 --maxrows 20 ...
<?xml version="1.0" encoding="ISO-8859-1"?>
<xport>
<meta>
<start>1224374400</start>
<step>86400</step>
<end>1225238400</end>
<rows>11</rows>
...
And note that:
1224374400 = 2008-10-19 00:00 GMT = <start>
1225238400 = 2008-10-29 00:00 GMT = <end>
1225238400 - 1224374400 = 864000
I'm stuck here ...
________________________________
Sent: Tuesday, October 28, 2008 6:33 PM
To: 'rrd-users at lists.oetiker.ch'
Subject: xport and time zones
Hello all,
I have data in a couple of rrd databases (one per server) and I'm interested in the daily average and maximum of the sum of this data.
Note that I need to sum the data first (it is in 15 minutes intervals by the way) before I can know the maximum of the sum.
So I am using the rrdtool xport function as I want rrdtool to do the CDEF calculations on these .rrd's (as opposed doing fetch and do all myself).
For daily results (one day is 864000 seconds) over a 10-day period, I need to use (per recommendation from the RRDtool web site and this list):
end time == int(t/86400)*86400,
start time == end time - 864000,
resolution == 86400
But now comes the tricky part: these calculations assume epoch seconds and so result in data from midnight to midnight UTC.
However I am interested not in 24h periods that match UTC days, but I need it in another time zone (e.g. 00:00 PST8PDT).
I have been playing with setting TZ variable but xport doesn't seem to take that (I am working on a red hat linux machine).
Doing something like
$ TZ=PST8PDT rrdtool xport ...
does not get me what I am after. The <start> element is not on my desired time zone boundary but on 00:00 GMT (note <step> is OK: 86400):
<xport>
<meta>
<start>1224374400</start>
<step>86400</step>
<end>1225238400</end>
<rows>11</rows>
...
Anybody ran into this before and knows a solution?
Thanks in advance for any feedback!
Dirk
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20081029/6d9cce11/attachment.html
More information about the rrd-users
mailing list