[ZBX-11057] Graph item line becomes dotted if item use only scheduling intervals. Created: 2016 Aug 04  Updated: 2017 May 30  Resolved: 2016 Sep 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 3.0.4
Fix Version/s: 3.0.5rc1, 3.2.0rc1

Type: Incident report Priority: Trivial
Reporter: vitalijs.cemeris (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: graph, scheduling, trends
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If item is configured only with scheduling intervals and scheduling interval delay is more than 5h, then graph line for this item becomes dotted.
This happens only if data is from trends.

If item have at least one scheduling interval and if update interval is 0 and item have no flexible intervals than item line should be drawn as trapper item.
Same issue was described in ZBX-10789 however it didn't fix case when data is from trends.



 Comments   
Comment by Verkh Rodion [ 2016 Aug 04 ]

Just in case, duplicate my comment from ZBX-10789

I guess it happens, because delay override in if-else statement in include/classes/graphdraw/CLineGraphDraw.php:285

 $this->items[$i]['delay'] = max($this->items[$i]['delay'], SEC_PER_HOUR);

delay will be 3600

i am try to little edit this if-else statement in include/classes/graphdraw/CLineGraphDraw.php:285 and add if-else statement like in include/classes/graphdraw/CLineGraphDraw.php:2659 and now it correctly work for graphs with trends data.

@@ -281,8 +281,16 @@
 						' AND clock<='.zbx_dbstr($to_time).
 					' GROUP BY itemid,'.$calc_field
 				);
-
-				$this->items[$i]['delay'] = max($this->items[$i]['delay'], SEC_PER_HOUR);
+				
+				
+				    foreach ($this->items[$i]['intervals'] as $interval) {
+					if ($interval['type'] == ITEM_DELAY_FLEX_TYPE_SCHEDULING && $this->items[$i]['delay'] == 0) {
+					    $this->items[$i]['delay'] = 0;
+					}
+					else{
+					    $this->items[$i]['delay'] = max($this->items[$i]['delay'], SEC_PER_HOUR);
+					}
+				    } 			}
 
 			if (!isset($this->data[$this->items[$i]['itemid']])) {


But, i am not very good in php, so i am not sure that this is good way for fix

Comment by vitalijs.cemeris (Inactive) [ 2016 Aug 08 ]

(1) No translation strings changed.

sasha CLOSED

Comment by vitalijs.cemeris (Inactive) [ 2016 Aug 08 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-11057

Comment by Gunars Pujats (Inactive) [ 2016 Aug 26 ]

(2) Code style
include/classes/graphdraw/CLineGraphDraw.php:2735 - do we really need static function? And maybe this function could be placed in other class, because it is not directly related to graphs.

vitalijs.cemeris As discussed with sasha, hasScheduling() helper method should not be moved.

RESOLVED in r62171

gunarspujats CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 Sep 01 ]

Tested.

Comment by vitalijs.cemeris (Inactive) [ 2016 Sep 02 ]

Fixed in:

  • pre-3.0.5.rc1 r62192
  • pre-3.2.0beta3 r62195
Generated at Sat Apr 27 04:38:03 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.