[ZBX-8772] Not correct time in maintenance Created: 2014 Sep 17  Updated: 2017 May 30  Resolved: 2015 Sep 21

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.6
Fix Version/s: None

Type: Incident report Priority: Major
Reporter: Sergey Korobeiko Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: maintenance, timezone
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2014-09-17 at 15.42.39.png     PNG File Screen Shot 2014-09-17 at 15.46.57.png    
Issue Links:
Duplicate
is duplicated by ZBXNEXT-2512 Current time as a default time for a ... Closed

 Description   

Zabbix Server 2.2 works in UTC. Admin from USA creates maintenance period: click button "calendar" and "Now" - Time is set from USA timezone(current time from OS) and is not valid for maintenance now.
Zabbix frontend must use time from server.

Before in zabbix 2.0 fields "Active since" and "Active till" by default were from current server time and were not needed to edit. It related to "one time only" period too. Will be enough to make behavior "maintenance" though as zabbix 2.0



 Comments   
Comment by Sergey Korobeiko [ 2014 Sep 17 ]

how it was and now

Comment by Sergey Korobeiko [ 2014 Sep 18 ]

I found what need to change.

maintenance.php
443c453
< $data['active_since'] = strtotime('today');
---
> $data['active_since'] = time();

454c464
< $data['active_till'] = strtotime('tomorrow');
---
> $data['active_till'] = time() + SEC_PER_DAY;
/include/forms.inc.php
$date = zbxDateToTime($new_timeperiod['start_date']
#? $new_timeperiod['start_date'] : date(TIMESTAMP_FORMAT_ZERO_TIME, time()));
? $new_timeperiod['start_date'] : date(time()));
Comment by richlv [ 2014 Oct 03 ]

ZBX-5939 might be related

zalex_ua I don't think so.

Comment by Aleksandrs Saveljevs [ 2014 Oct 15 ]

This might or might not be a regression from ZBXNEXT-1806.

Comment by Oleksii Zagorskyi [ 2015 Sep 21 ]

Even if it was a regression which caused problems after upgrade, most likely we cannot change things back.
It's not very clear is there any bug actually or not.

Take into account ZBX-8178

Closed as incomplete.

Comment by Oleksii Zagorskyi [ 2015 Sep 21 ]

Well, now I've got it, I can confirm the regression for 2.2.
But ... does't it worth to be changed back?

I'd say that 00:00 as defaults are not so bad - they force you to review and set new time correctly.
Let's leave is won't fix.

Comment by Sergey Korobeiko [ 2015 Sep 21 ]

00:00 as defaults are not so bad, but useless. Current time is very useful for users who don't care about time on server and want to start maintenance right now. I talk about "one time only" period.

Comment by Oleksii Zagorskyi [ 2015 Sep 21 ]

Interesting point, thanks!
But with a note - not server's time, but frontend's time (Apache+PHP) does matter.

Tested just in case, and indeed suggested time value (in 2.0) is not affected by possibly different browser's timezone (thinking about ZBX-5939).
So suggested time value was correct as for server's timezone in any case.

Comment by Sergey Korobeiko [ 2015 Sep 21 ]

After upgrading from 2.0 to 2.2 00:00 in maintenance was not expected. Many our zabbix users made mistakes. They are used to don't look at time because there was current time, not 00:00.

Generated at Fri Mar 29 08:18:08 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.