[ZBX-1076] IT Services SLA for "this month, week, year" not calculated correctly. Created: 2009 Oct 08 Updated: 2017 May 30 Resolved: 2009 Oct 09 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 1.6.6, 1.9.0 (alpha) |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Edward Rudd | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
CentOS 4 running PHP 5.1.6 on mysql 5.0 |
Attachments: | zabbix-1.6.6-sla.diff |
Description |
While reviewing the srv_status.php in order to patch in "previous week/month/year" functionality I noticed a rather odd thing. the value of $period_start_sec is inconsistent. for the "today, this week/month/year" a absolute unix timestamp is stored in the variable. However, for the "last 7/30/365 days" options a "relative" value is stored in the variable. Later on when the extents of the SLA are calculated (the $start and $end variables) the $period_start_sec is treated as a relative instead of an absolute. Thus, if you choose "this month" you actually get EVERYTHING. as $start is calculated as $now-(time for beginning of month) So for example.. $now = time(); // assume 2009-10-30 14:00 localtime; now when $start is calculated it is this $start = $now - $period_start_sec; this results in pulling in ALL sla history all the time (as no one has sla alarm data for 1970) I have a patch I'll attach that fixes this issue. |
Comments |
Comment by Edward Rudd [ 2009 Oct 08 ] |
this is a patch based on Zabbix 1.6.6 that resolves the incorrect SLA calculations for "today, this week / month / year" It also takes an approach that allows the $end to be altered by the "selection" so future time periods like "previous month" can easily be added in. |
Comment by Alexey Fukalov [ 2009 Oct 09 ] |
fixed in 1.6 branch 8053 |
Comment by richlv [ 2009 Nov 10 ] |
close old, resolved issues |