[ZBX-9257] No history links in trigger popups for triggers with 2 or more items Created: 2015 Jan 28  Updated: 2017 May 30  Resolved: 2015 Feb 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.4.3
Fix Version/s: 2.4.4rc1, 2.5.0

Type: Incident report Priority: Major
Reporter: Jakub Kuchta Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: regression, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All browsers (PHP issue)


Attachments: PNG File 1.png     PNG File 2.png     PNG File trigger_hosts_after.png     PNG File trigger_hosts_before.png    
Issue Links:
Duplicate
duplicates ZBX-9083 Links to history of items not appear ... Closed

 Description   

If we create a trigger with at least two items in expression, the popup window will not show links to history of the items. (1.png).

I've tracked down the issue to tr_status.php, line 547, but the problem probably lies somewhere in setMenuPopup or getTrigger.
$description->setMenuPopup(CMenuPopupHelper::getTrigger($trigger, $triggerItems));

Checking the value of the array returned by getTrigger:

$descArray = CMenuPopupHelper::getTrigger($trigger, $triggerItems);
print_r($descArray);

Array ( 
[type] => trigger 
[triggerid] => 15217 
[items] => Array ( 
  [1] => Array ( 
    [name] => Procent wolnego miejsca na C: 
    [params] => Array ( 
      [itemid] => 30666 
      [action] => showgraph 
    ) 
  ) 
  [0] => Array ( 
    [name] => Wolne miejsce na C: 
    [params] => Array ( 
      [itemid] => 30665 
      [action] => showgraph 
    ) 
  ) 
) 
[acknowledge] => [eventTime] => [configuration] => Array ( 
    [hostid] => 10276 
) [url] => [showEvents] => 1 )

The index of the nested array "index" starts at 1 - something futher down doesn't cope well with this.
A simple fix which fixed the issue:

$description = new CSpan($trigger['description'], 'link_menu');
$triggerPopupData = CMenuPopupHelper::getTrigger($trigger, $triggerItems);
sort($triggerPopupData['items']);
$description->setMenuPopup($triggerPopupData);


 Comments   
Comment by richlv [ 2015 Jan 29 ]

(1) not directly related, but a minor issue :
if a trigger references items from two hosts, previously they were shown on one line, if there was enough space. now they are split in two lines even if there's more than enough space.

before :

after :

regression, broken by :

------------------------------------------------------------------------
r38449 | eduards | 2013-09-12 12:06:15 +0300 (Thu, 12 Sep 2013) | 3 lines

A.F.I..... ZBXNEXT-1786 implemented script name tree in menu popups (Eduard, Sasha)
..F....... ZBXNEXT-1786 redesigned menu popups using jQuery Menu (Eduard)
..F....... ZBXNEXT-1786 updated jQuery-ui to latest (Eduard)
------------------------------------------------------------------------

if this can not be handled in this issue, please split it out in a separate issue

iivs RESOLVED for:

  • 2.4 in svn://svn.zabbix.com/branches/dev/ZBX-9257 r51910
  • trunk in svn://svn.zabbix.com/branches/dev/ZBX-9257-trunk r51931

sasha CLOSED

Comment by richlv [ 2015 Jan 29 ]

confirming in trunk r51893; seems to happen when trigger references items from more than one host

regression, caused by :

------------------------------------------------------------------------
r41617 | eduards | 2014-01-17 14:25:52 +0200 (Fri, 17 Jan 2014) | 8 lines

..F....... ZBXNEXT-2073 improved dashboard refresh time menu
..F....... ZBXNEXT-2073 improved dashboard favourite menu
..F....... ZBXNEXT-2073 improved dashboard refresh time menu
..F....... ZBXNEXT-2073 improved service configuration menu
..F....... ZBXNEXT-2073 improved slide show refresh multiplier menu
..F....... ZBXNEXT-2073 improved trigger log menu
..F....... ZBXNEXT-2073 improved trigger macros menu
..F....... ZBXNEXT-2073 update jQuery to latest 1.10.2
------------------------------------------------------------------------

Comment by richlv [ 2015 Jan 29 ]

(2) the links are missing in monitoring -> triggers. they are still there in monitoring -> overview, but they did not have host prefixed even before the regression in r41617.

let's figure out why those menus are different and fix them in all places we can think of.

looks like... if items with different keys are from 2 different hosts, links are missing in monitoring -> triggers, and they are available, but without host prefix.
if items are from 2 different hosts but with the same key, item links also disappear in the overview page.

iivs another similar thing happens: trigger with 2 items from same host seems to work, but 3 no longer work (even if all if them are supported). Not it Monitoring->Overview and not in Monitoring->Triggers.

iivs RESOLVED for:

  • 2.4 in svn://svn.zabbix.com/branches/dev/ZBX-9257 r51909
  • trunk in svn://svn.zabbix.com/branches/dev/ZBX-9257-trunk r51930

sasha The links are not sorted.

REOPENED

iivs As discussed, I move item retrieval code in one place and fixed sorting.
RESOLVED for 2.4 only in svn://svn.zabbix.com/branches/dev/ZBX-9257 r51964

sasha Any API calls should be outside menu helpers.

REOPENED

iivs RESOLVED in r52079

sasha CLOSED

Comment by Ivo Kurzemnieks [ 2015 Jan 30 ]

RESOLVED for:

  • 2.4 in svn://svn.zabbix.com/branches/dev/ZBX-9257
  • trunk in svn://svn.zabbix.com/branches/dev/ZBX-9257-trunk
Comment by Alexander Vladishev [ 2015 Feb 09 ]

(3) Take a look at my changes in r52107.

iivs Thanks!
CLOSED.

Comment by Ivo Kurzemnieks [ 2015 Feb 09 ]

Fixed:

  • displaying missing history links in trigger context menu,
  • added missing host prefix before items in trigger context menu if trigger belongs to multiple hosts,
  • changed displaying host list from vertical to horizontal if trigger belongs to multiple hosts.

Fixed in:

  • pre-2.4.4rc1 r52109
  • pre-2.5.0 (trunk) r52110
Generated at Fri Mar 29 17:57:11 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.