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

Marco Marongiu brontolinux at gmail.com
Tue Jan 11 13:08:16 CET 2011

Hi Alex, all.

I found what was wrong, rrdtool was not the culprit but I am reporting
here anyway so that everybody knows.

First, remind that the server where data is collected has the clock set
to UTC, while the server where the report is assembled is CET, so UTC+1.

To calculate timestamps from date, I was using Date::Calc's Mktime, both
when aggregating the files, and when creating the report.

Unfortunately, Mktime is sensitive to the timezone setting of the
machine it is running on. So while the problem was "invisible" for my
cacti-derived files, it inexorably showed up with the file that came
unchanged from the server.

Using Date::Calc's Date_to_Time instead of Mktime (on both the
aggregator and the reporter) fixed the problem. In fact, as the pod
reports for this function:

>          Under Unix, the date and time are considered to be in UTC
>          ("Universal Time Coordinated", and so is the resulting time
>          value.

Thanks all for the hints!


More information about the rrd-users mailing list