[rrd-users] Odd mismatch in fetch results (via Perl/CLI)

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Fri Jan 7 13:00:00 CET 2011


> Alex van den Bogaerdt:
>> According to http://www.onlineconversion.com/unix_time.htm
>> 1291158000 is 23:00 UTC.
>> http://www.epochconverter.com/ agrees.
>> You expected midnight UTC here?
>
>
> Yep. As you can see from the perl call that "stringifies" the timestamp:
>
>>         @$timestamps =
>>           map { scalar gmtime( $start + $_ * $step ) } (0..$#$data) ;
>
>
> And it actually does it for all the aggregated RRD files:
>
>> Wed Dec  1 00:00:00 2010	10,61
>> Wed Dec  1 01:00:00 2010	10,61
>> Wed Dec  1 02:00:00 2010	10,34
>
>
> but that one:
>
>> Tue Nov 30 23:05:00 2010
>> Tue Nov 30 23:10:00 2010
>> Tue Nov 30 23:15:00 2010
>
>
> Any ideas?

You ask for start time 1291158000 and the first entry you get
has end time 1291158300, which is correct.

What bothers you is that 1291158000 is 23:00:00, not midnight.

Either those two sites get it wrong, or 1291158000 is indeed 23:00 and you
get what you ask for.

Your original post:
> But this doesn't make sense: if I use "rrdtool fetch" directly
> from the command line and with the same parameters as the
> script, I get thevalues I expect:

> $ rrdtool fetch rrd/t*.rrd AVERAGE -s 1291158000 \
> -e 1293836400 | awk '/:/ { print $1 }' | head -n 3
> 1291158300:
> 1291158600:
> 1291158900:

1291158000 is november 30th, 11pm UTC, according to the various sites.
Check it, I cannot right now except for using those sites.

If these sites are correct, then somehow you or your system seems to be
confused, thinking that this all works on UTC time, while it actually
seems to be running on 1 hour distance from UTC. So instead of looking at
that one odd out, you should be looking at the rest, because that one
'weird' one is actually correct.

HTH
Alex




More information about the rrd-users mailing list