Nectar - Events Issues (times and dates)

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Nectar - Events Issues (times and dates)

Post by mcutting »

Nectar does not appear to save dates and times correctly.

Steps to reproduce:

1. Create a report
2. Set a date and time for it to be sent
3. Click the Nectar tab
4. Observe the date and time - incorrect on my system, and not the time I chose
5. Go into the report again, and observe the date and time - incorrect

Entering the correct UNIX time into the database directly shows the correct time, however, when you review a report, then click the Nectar tab, the time and date is incorrect again.

Also, then clicking "Events" tab, I get


Notice: Undefined variable: now in /usr/share/cacti/site/plugins/nectar/nectar_webapi.php on line 746

Any thoughts ?

Using the 0.28Beta2 version recently posted.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

MySQL timestamp looks to be correct

current_timestamp
2010-06-23 14:24:15

SYSTEM timestamp is also correct

Wed Jun 23 14:24:18 BST 2010
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Thought I'd try 2010/23/06 and 06/23/2010 - neither of these seem to make any difference. The date is correct, but the time is miles off.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please give an example. You listed the correct time but not the incorrect one. Is it always a constant offset?
R.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Nectar - Events Issues (times and dates)

Post by gandalf »

mcutting wrote: Notice: Undefined variable: now in /usr/share/cacti/site/plugins/nectar/nectar_webapi.php on line 746
Please change that line to read

Code: Select all

$timestamp = time();
and retry.
R.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

I guess I should have been clearer. What actually happens is that if I change the report date and time to 23/06/2010 23:00:00
It default to the current time when saved.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Re: Nectar - Events Issues (times and dates)

Post by mcutting »

gandalf wrote:
mcutting wrote: Notice: Undefined variable: now in /usr/share/cacti/site/plugins/nectar/nectar_webapi.php on line 746
Please change that line to read

Code: Select all

$timestamp = time();
and retry.
R.
Tried that earlier when looking at the file. The $now variable is set to $now=time(), so I already tried the suggestion above, but got the same result.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Nectar - Events Issues (times and dates)

Post by gandalf »

mcutting wrote:but got the same result.
You still got the

Code: Select all

Notice: Undefined variable: now in /usr/share/cacti/site/plugins/nectar/nectar_webapi.php on line 746 
I can't believe that.
You may still get "wrong" event timing, yes. That was not what I was tackling by this change.
For the wrong times, please answer the questions from above:
an Example showing
- wrong time
- correct time
- system time
- "mysql time"
would be fine. Again, when doing this on different reports, is there a constant offset between "correct" and "incorrect" time?
R.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Reinhard,

On my way home now, so will look at this tomorrow.

However, if I comment that line out, the error listed above goes away.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

I can't believe that.
My apologies - thanks to a strange caching issue in Firefox, the error persisted as the page wasn't being refreshed. I've fixed this now, so "time();" works fine.
You may still get "wrong" event timing, yes. That was not what I was tackling by this change.
For the wrong times, please answer the questions from above:
an Example showing
- wrong time
Not sure how I'm going to show you this. If I enter the time I'd like the report to be sent, and click save, the value is overwritten with the current date and time (in Nectar)
- correct time
Again, the "correct time" is being entered as (example) "24/06/2010 23:00:00"
- system time
date
Thu Jun 24 08:43:04 BST 2010
- "mysql time"
select current_timestamp;
current_timestamp
2010-06-24 08:48:36
Again, when doing this on different reports, is there a constant offset between "correct" and "incorrect" time?
The same issue is persistent across the two reports that I have currently configured.

If this isn't the information you're looking for, please let me know.

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mcutting wrote:I guess I should have been clearer. What actually happens is that if I change the report date and time to 23/06/2010 23:00:00
It default to the current time when saved.
Accidentally, I was skipping this post.
Bottom line is, that alwas current time is used even if a different time was request. Now I understand better and will look into it.
R.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

Many thanks.
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

mcutting wrote:Many thanks.
De rien. I was not aware of your french skills :o :) :D
R.
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

:) I used Google Translator !

Thing is, lots of people use this site from all sorts of far-flung places. I wanted to help (in the community spirit), so I just told him to create his post in English to attract more support
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
mcutting
Cacti Guru User
Posts: 1884
Joined: Mon Oct 16, 2006 5:57 am
Location: United Kingdom
Contact:

Post by mcutting »

gandalf wrote:
mcutting wrote:I guess I should have been clearer. What actually happens is that if I change the report date and time to 23/06/2010 23:00:00
It default to the current time when saved.
Accidentally, I was skipping this post.
Bottom line is, that alwas current time is used even if a different time was request. Now I understand better and will look into it.
R.
Reinhard,

Any developments with this please ? I pulled the latest copy out of SVN, but the problem seems to still exist.

Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests