Cacti Timezone Support

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

Well, I gave it a try but i didn't quite understand how the patch file is to be read. I understand only two files (include/global_settings.php and lib/rrd.php) should be edited and code is only added, not removed or replaced. But why are the two files mentioned 3 times in the patch file? I guess that's the way the svn works. It refers to 3 coding-sessions? I'll give it another try. Or is there someone here who can produce the modified files with a simple push on a button? If so, please pm me. Thx
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

I still don't care to use the mysql index of timezone, as it only available on mysql.

Maybe we have a internal table or file that contains time zones?

I have to ponder what data we can get a the OS level with concerns to time zones.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

rony wrote:I still don't care to use the mysql index of timezone, as it only available on mysql.

Maybe we have a internal table or file that contains time zones?

I have to ponder what data we can get a the OS level with concerns to time zones.
This would be easy enough to do, just modify the MySQL sql file. Outside of Windows, and a few other UNIX varients, it just reads the OS' timezone information via a script and creates the tables from the entries there... Search out the import script. Thie nice things is it's automatic, and we can make DB independent if we add the tables to Cacti's database.

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Let's talk about this, at this point I feel I'm missing some pieces.

Larry call me concerning, I want to understand.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Just to let everyone know, who is monitoring this thread. We talked, and then talked about something different. Bottom line, this feature is not done. Per Tony's note, we have to think about database portability (hint hint).

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
pbw
Posts: 1
Joined: Fri Mar 27, 2009 7:08 am

Post by pbw »

I'd love to see this option as a standard one in cacti. But integration with the timezone tables on different platforms is a big challenge. A plugin for linux would be appreciated though. I don't like these modifications that keep me from updating in the futere.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Well, so far, I don't have anyone who has said this works? If someone can tell me it works, then we can do it differently. We need someone to test and provide feedback. I don't have time right now. (Too busy answering forum posts) ;)

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

TheWitness wrote:We need someone to test and provide feedback.
I gave it another try and I followed your instructions. Te result: I can select another timezone in the graph settings. But it has no effect on the graphs (after logging out & in again).

Where is the information about the difference in time between the zones? "mysql.time_zone_name" doesn't contain this info. How does the patch get this information to edit the X-axis of the graphs?

This is what I did:
- fresh install of cacti 0.8.7d with default localhost graphs, working.
- filled the mysql time zone tables. (They were there already, but were empty)
- changed the mysql permissions to allow the user to select the tables
- applied the patch (by hand)
- changed the Default time zone from "default" to somethint exotic.
- logged out and in again.
-> no result
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You are on Linux right? I may have some time on Sunday?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

@ TheWithess: I'm not sure I applied the patch correctly. Could you generate the patched files for me? I'll try it again then.
OR: I have time in the evenings. Thats in the +1 timezone.
:P
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

In general, I don't support the 086 branch anymore.

Larry
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

grasland wrote:This is what I did:
- fresh install of cacti 0.8.7d with default localhost graphs, working.
TheWitness wrote:In general, I don't support the 086 branch anymore.

Larry
Did you mean my outdated signature? I'm not using 0.8.6x. You got us this far, I believe it could work!
User avatar
snupple
Posts: 2
Joined: Sun Apr 05, 2009 11:49 pm
Location: Perth, West Australia

Post by snupple »

I had a go, had to manually edit the php files... I did notice that you seemed to have the info in the patch file duplicated 3 times?

The setting appears and the dropdown box has the list of timezones you can select, so I set a different timezone, logged out and logged back in again, but nothing has changed, all the graphs are still rendering at the same timezone.

EDIT: Just found a bunch of SQL errors in the poller log, just looking through it now

Code: Select all

04/11/2009 06:23:44 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"UNIX_TIMESTAMP(UTC_TIMESTAMP())-UNIX_TIMESTAMP(CONVERT_TZ(NOW(), 'GMT', 'Singapore')))"

This seems to be the problem
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

One too many end parens and missing a select. Can you make that change? Should be:

Code: Select all

SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP())-UNIX_TIMESTAMP(CONVERT_TZ(NOW(), 'GMT', 'Singapore'));
TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
snupple
Posts: 2
Joined: Sun Apr 05, 2009 11:49 pm
Location: Perth, West Australia

Post by snupple »

ok, changed that, getting a bit further..

When the default timezone is set it uses this SQL statement:

Code: Select all

04/12/2009 11:54:14 PM - CMDPHP: Poller[0] DEVEL: SQL Exec: "replace into settings_graphs (user_
id,name,value) values (1,'default_timezone', '557')"


But, when its read it uses this one:

Code: Select all

04/13/2009 12:00:18 AM - CMDPHP: Poller[0] DEVEL: SQL Row: "select value from settings_graphs where name='default_timezone' and user_id=0" 
user_id=0 ??? shouldnt it be 1?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests