Cacti Timezone Support

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

cactipete
Posts: 1
Joined: Thu Feb 21, 2008 5:07 pm

Cacti Timezone Support

Post by cactipete »

This is probably extreme, but...

We have a central cacti server that polls information from many machines at different time zones.

Without having multiple cacti servers (at each time zone), is it possible to create graphs that show times in relation to each time zone? i.e. A graph for a Boston machine may show 12:20 and one for a Los Angeles machine will show 9:20.

Ultimately, we're looking at our graphs to be timezone specific for the client machines.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please pm either Frizz or browniebraun for this. I know for sure, that they are struggeling with exactly the same problem
Reinhard
grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

And plz post the solution. There are more people searching for it.
:lol:
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

1) Install the TimeZone support from MySQL.
2) Create a "new" Graph Setting Called... Hold on let me make a patch... you still have to do step 1) though...

I'll post a patch in 10 minutes.

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
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It'll take a few more than that. Just realized something... :)

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
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Ok, here you go. You must follow the procedure below:

1) Goto http://dev.mysql.com/doc/refman/5.0/en/ ... pport.html and read and follow instructions.
2) Do the following, you may have to change for your setup:

Code: Select all

mysql cacti
> grant select on mysql.time_zone_names to 'cactiuser'@'localhost' identified by 'somepassword';
3) Apply the patch
4) Goto Graphs->Settings and Set the Timezone.
5) View Your Graphs

Note, if you change the setting, after you have done it once, you have to logoff and log back in again.

TheWitness

ps. I have not tested this. So, please comment.
pss. This will not work on Windows unless you are using the Cygwin version of RRDtool (pretty sure anyway, confirmation would be good).

EDIT: Had to re-upload after I realized something bad "might" happen.
EDIT: Tested on Windows w/Cygwin to No Avail.
Attachments
Cacti087d_TimeZonePatch.patch
(8.35 KiB) Downloaded 3656 times
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 »

Thanks! I'll test it this week. I hope it works!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

So, its built for 087d. Therefore you will have some light lifting to do. Let us know though.
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
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Any feedback???

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
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

???

Why do you need mysql to "support" timezone?

I'm confused, this is a poor requirement...
[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 »

MySQL gives us the offset automatically from the user specified timezone. In general, it's simpler and supported by MySQL, so we don't have any extra work. Is it portable? Not sure. We can do it in Javascript too, but it would be based upon the timezone of the users workstation and not neccessarily (but most likely) in the right timezone.

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
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Let's talk, mysql is the wrong approach for database independence in the future.

All timestamps should be stored in UTC and converted to the users timezone.
[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
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Plus, how is doing that per the mysql user that Cacti users going to support different Cacti user of the Cacti interface.

This is the wrong approach.

:o
[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]
grasland
Posts: 12
Joined: Wed Aug 08, 2007 2:35 pm

Post by grasland »

TheWitness wrote:Any feedback???

TheWitness
I finally found the time to test the patch you provided. Sorry for letting you wait all this time.
I made a clean cacti 0.8.7d install and I managed to load the timezone_name table in mysql. I'm not yet familiar with patching so I'll start studying. It starts to complain right away about not finding the file to be edited:

Code: Select all

patch -p1 -N < timezone.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: include/global_settings.php
|===================================================================
|--- include/global_settings.php        (revision 4937)
|+++ include/global_settings.php        (working copy)
--------------------------
File to patch:
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You may have to hand edit. I don't use patch very often and the format, from what I am told, from Tortoise SVN is not too compatible with Linux's patch command.

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?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests