Nectar - Events Issues (times and dates)
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
I've still not found the issue. But the attached tgz will help logging.
Unpack as usual.
Then, please save ./plugins/settings/include/mailer.php.
Copy ./plugins/nectar/0.8.7g/mailer.php to ./plugins/settings/include/mailer.php
Goto Settings -> Misc and set NECTAR logging level to at least MEDIUM. Now, you'll find NECTAR messages in log/cacti.log. It will log each call to the internal datetime function and more. Please provide those lines after a new try
R.
Unfortunately, I had to fix two errors that dropped in due excessive copying between different directories on my laptop.
Please drop old code and replace by the new
Unpack as usual.
Then, please save ./plugins/settings/include/mailer.php.
Copy ./plugins/nectar/0.8.7g/mailer.php to ./plugins/settings/include/mailer.php
Goto Settings -> Misc and set NECTAR logging level to at least MEDIUM. Now, you'll find NECTAR messages in log/cacti.log. It will log each call to the internal datetime function and more. Please provide those lines after a new try
R.
Unfortunately, I had to fix two errors that dropped in due excessive copying between different directories on my laptop.
Please drop old code and replace by the new
- Attachments
-
- nectar-v0.28b6.tgz
- UPDATED CODE
untar as usual
copy 0.8.7g/mailer.php to plugins/settings/include/mailer.php - (61.56 KiB) Downloaded 3127 times
Re: Nectar - Events Issues (times and dates)
I see the same issue, every time I make a change to anything on the page and save, the mailtime reverts to the current date/time.
Anyone else still having this issue?
Just installed Nectar yesterday 0.30 (replaced mailer.php file)
Anyone else still having this issue?
Just installed Nectar yesterday 0.30 (replaced mailer.php file)
TroyCacti Version - 0.8.7g
Plugin Architecture - 2.8
Poller Type - Cactid v
Re: Nectar - Events Issues (times and dates)
I changed my users Graph Date Display Format from "Month Name, Day, Year" to "Month Number, Day, Year" and that appears to have corrected the issue.
Re: Nectar - Events Issues (times and dates)
Hello!
Regardless of the graphs' settings, plugin only takes format "Month Number/Day/Year".
If you use any other format for input in a "Next Timestamp for sending Mail Report", it doesn't work.
P. S. My version is 0.30.
Regardless of the graphs' settings, plugin only takes format "Month Number/Day/Year".
If you use any other format for input in a "Next Timestamp for sending Mail Report", it doesn't work.
P. S. My version is 0.30.
-
- Posts: 4
- Joined: Wed May 16, 2012 3:38 am
Re: Nectar - Events Issues (times and dates)
Has this been resolved at all?
I'm seeing the same problem (Next timestamp changes to current system date and time) and need to know how to resolve.
Thanks,
Paul.
I'm seeing the same problem (Next timestamp changes to current system date and time) and need to know how to resolve.
Thanks,
Paul.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Nectar - Events Issues (times and dates)
Please provide you exact time format and the settings of the related nectar report. I'll (hopefully) try to reproduce the issue, then
R.
R.
Re: Nectar - Events Issues (times and dates)
Dear Sirs,
(First of all, it's my first time I post something to the forum - I really like Cacti/plugins a lot).
I was doing some research (try & error + analizing code) because I had the some problem. Just to give my 2 cent's:
Look inside the following paragraph, the 'note' (taken from http://php.net/manual/en/function.strtotime.php)
There is no easy way for the function 'strtotime' to avoid 'guessing' the right format (Personally, I think it's better to use ISO 8601 format, at least for internal uses).
You can get rid of this problem with some new features from php >= 5.3.0. Also you can get rid of this problem by using some 'C' alike functions for php (but they don't work with MS Windows)
Here it goes a patch for this date/time format issue which tries to avoid those known problems: (Hope it helps - Tested on Cacti 0.8.8a + Nectar plugin v0.35a)
Download and apply with:
gzip -dc nectar-v0.35a_sanitize_datetime_strings.patch.gz | patch -p0
Note: I'm running Cacti v0.8.8a + Spine v0.8.8 + plugins (including Nectar v0.35a) on a FreeBSD 8.3p4 box at work.
Regards,
Pablo Carboni.
(First of all, it's my first time I post something to the forum - I really like Cacti/plugins a lot).
I was doing some research (try & error + analizing code) because I had the some problem. Just to give my 2 cent's:
- - I faced the same problem with Non-US date/time formats. (In Argentina, we use 'dd-mm-yyyy hh:mm:ss'). Common date separators: slash char '/', dash char '-'.
- The problem (I think so) has relationship with PHP's strtotime behaviour: http://php.net/manual/en/function.strtotime.php.
Code: Select all
<?php
$it_doesnt_work_mailtime="27/02/2013 09:00:00";
$it_works_mailtime="02/27/2013 09:00:00";
$it_works2_mailtime="27-02-2013 09:00:00";
print "This string do not work: ".$it_doesnt_work_mailtime."\n";
$timestamp=strtotime($it_doesnt_work_mailtime);
if ($timestamp=="") { $timestamp="empty"; };
print "timestamp: $timestamp\n";
print "\n";
$timestamp=strtotime($it_works_mailtime);
if ($timestamp=="") { $timestamp="empty"; };
print "This string works: ".$it_works_mailtime."\n";
print "timestamp: $timestamp\n";
$timestamp=strtotime($it_works_mailtime);
if ($timestamp=="") { $timestamp="empty"; };
print "This string works too: ".$it_works2_mailtime."\n";
print "timestamp: $timestamp\n";
?>
Yes, you're right. 'strtotime' function doesn't work as expected.Note:
Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.
To avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) dates or DateTime::createFromFormat() when possible.
There is no easy way for the function 'strtotime' to avoid 'guessing' the right format (Personally, I think it's better to use ISO 8601 format, at least for internal uses).
You can get rid of this problem with some new features from php >= 5.3.0. Also you can get rid of this problem by using some 'C' alike functions for php (but they don't work with MS Windows)
Here it goes a patch for this date/time format issue which tries to avoid those known problems: (Hope it helps - Tested on Cacti 0.8.8a + Nectar plugin v0.35a)
Download and apply with:
gzip -dc nectar-v0.35a_sanitize_datetime_strings.patch.gz | patch -p0
Note: I'm running Cacti v0.8.8a + Spine v0.8.8 + plugins (including Nectar v0.35a) on a FreeBSD 8.3p4 box at work.
Regards,
Pablo Carboni.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Nectar - Events Issues (times and dates)
I will consider this on the next update cycle. But I will have to test as well
R.
R.
Who is online
Users browsing this forum: No registered users and 3 guests