What is wrong with cacti daylight savig time?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
e2rd
Posts: 6
Joined: Sun Oct 26, 2014 4:56 am

What is wrong with cacti daylight savig time?

Post by e2rd »

Hello,
I'm little angry about cacti every 2 times a year becouse of 1-hour gap in graphs. ;)
I've attached two graphs: one made by caci, and second made by smokeping on the same server.
In cacti there is a 1-hour gap at 2:00am, and at 3am is spike.
Ive got this problem on every (3) my installation cacti.

In public-avaliable cacti you see there is the same:
https://ciist.ist.utl.pt/cacti/graph_vi ... eaf_id=595
http://netmon.acad.bg/cacti/graph_view. ... leaf_id=27

in rrd file there is the same:

Code: Select all

1414281000: 1,1475908021e+01 2,6459624444e+03
1414281300: 1,1441988725e+01 2,6526229181e+03
1414281600: -nan -nan
1414281900: -nan -nan
1414282200: -nan -nan
1414282500: -nan -nan
1414282800: -nan -nan
1414283100: -nan -nan
1414283400: -nan -nan
1414283700: -nan -nan
1414284000: -nan -nan
1414284300: -nan -nan
1414284600: -nan -nan
1414284900: -nan -nan
1414285200: -nan -nan
1414285500: 1,1279069767e+01 2,6527973422e+03
1414285800: 1,1294060304e+01 2,6331523637e+03
1414286100: 1,2298924192e+01 2,6541265393e+03
If rrd file is saved in unix time why cacti made gaps?
Only cacti has gaps; other tools dont work in this way - see attached graph from smokeping
php has configured timezone Europe.berlin.
How to resolve this becouse I think that this is a serious bug or misconfiguration(?) of cacti.
Attachments
other graphs - smokeping (the same server)
other graphs - smokeping (the same server)
smokeping.png (13.34 KiB) Viewed 3035 times
graphs made by cacti
graphs made by cacti
cacti.png (19.55 KiB) Viewed 3035 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: What is wrong with cacti daylight savig time?

Post by cigamit »

Data is stored by time. The 2:00 to 3:00 time, literally did not exist, so ofcourse we couldn't store data in it. When the time zone falls back, you lose an hour of data also, since it tries to write it on a period of time that was already written to. IMO its not a serious problem, it only happens twice a year. There are more important issues in the world to worry about.
e2rd
Posts: 6
Joined: Sun Oct 26, 2014 4:56 am

Re: What is wrong with cacti daylight savig time?

Post by e2rd »

cigamit wrote:Data is stored by time. The 2:00 to 3:00 time, literally did not exist, so ofcourse we couldn't store data in it. When the time zone falls back, you lose an hour of data also, since it tries to write it on a period of time that was already written to. IMO its not a serious problem, it only happens twice a year. There are more important issues in the world to worry about.
Time between 2:00 and 3:00 exist two times - see smokeping: there is two 2:00 hour. Other tool collecting network traffic writen in perl also doesnt have gap.
How data is stored by cacti? Imho data stored in .rrd file is in unix time; in unix time there is no timezone change - there should be no gaps. Every linux/unix system measure time in unix time, only "display" of data relay on timezone settings. (f.e: ls -l display time of modification files depends of time zone set by shell enviroment).
Why cacti does someting with time before write data? Only display graphs sholud depends on timezone.
This shouldn't be an issue at all!
Attachments
perl_rrd.png
perl_rrd.png (7.16 KiB) Viewed 3024 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: What is wrong with cacti daylight savig time?

Post by cigamit »

Cacti uses whatever timezone you have set. What time zone do you have PHP using? Maybe switch it to GMT/UTC?
e2rd
Posts: 6
Joined: Sun Oct 26, 2014 4:56 am

Re: What is wrong with cacti daylight savig time?

Post by e2rd »

If I changed to UTC only fileds "From" and "To" are affected - not graphs.
But why sholud I switch to UTC? I'm not living in UTC. As I said in first post - timezone is Europe/Berlin.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: What is wrong with cacti daylight savig time?

Post by cigamit »

UTC is not affected by daylight savings time, so if you want no gap, then that is why you would switch to it. Otherwise, live with the 1 gap for the entire year. Those are currently your 2 choices.
e2rd
Posts: 6
Joined: Sun Oct 26, 2014 4:56 am

Re: What is wrong with cacti daylight savig time?

Post by e2rd »

Yeah, but this is not solution, this is workaround ;)
Other tools have no gaps, cacti shlould not have gaps too.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: What is wrong with cacti daylight savig time?

Post by cigamit »

Cacti is Open Source, you are free to rewrite the source to save in UTC, and revert back to the User Time Zone when displaying the data, and then submit a patch to
http://bugs.cacti.net
Or submit a bug and hope someone else cares about that gap enough to make the modification.
dmrz
Posts: 2
Joined: Mon Nov 07, 2016 8:00 pm

Re: What is wrong with cacti daylight savig time?

Post by dmrz »

I think I've figured out what's wrong and how to fix it:
http://bugs.cacti.net/view.php?id=2797
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: What is wrong with cacti daylight savig time?

Post by phalek »

The patch will only add a new column, which will be ignored by the rrd update process. You will have to use the original column and overwrite it in case you want to use this or change the other files for updating the rrd files accordingly.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
dmrz
Posts: 2
Joined: Mon Nov 07, 2016 8:00 pm

Re: What is wrong with cacti daylight savig time?

Post by dmrz »

dmrz wrote:I think I've figured out what's wrong and how to fix it:
http://bugs.cacti.net/view.php?id=2797
bugs.cacti.net appears to be gone now, but I've submitted the bug report again at https://github.com/Cacti/cacti/issues/1061, and a new simpler fix for Cacti 1.1.27 at https://github.com/Cacti/cacti/pull/1062
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests