[ZBX-7713] Displaying correct hostname in trigger and events screen Created: 2014 Jan 28  Updated: 2024 Apr 10  Resolved: 2014 Jan 31

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.8.19, 2.0.10, 2.2.1
Fix Version/s: 2.3.0

Type: Problem report Priority: Trivial
Reporter: Kodai Terashima Assignee: Martins Valkovskis
Resolution: Fixed Votes: 0
Labels: hosts, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File event-details-of-localhost1.png     PNG File event-details-of-localhost2.png     PNG File event-list-of-localhost1.png     PNG File event-list-of-localhost2.png    
Issue Links:
Duplicate
Team: Team D
Team: Team D
Sprint: Sprint 53 (Jun 2019)
Story Points: 0

 Description   

Host name is not displayed correctly if trigger expression has different hosts.

For example, localhost1 has a trigger below:

{localhost1:trapper.test.last(0)}=0 & {localhost2:trapper.test.last(0)}=0

Then both agent.ping item received 0, information of localhost2 shows "localhost1" as a host name on trigger and events screen. Please see attached screenshots.

It's better to display "localhost2" as a host name on localhost2 screen.



 Comments   
Comment by Oleksii Zagorskyi [ 2014 Jan 29 ]

I think in such cases would be more correct to show both (all) host names on the "tr_events.php".
Because actually a trigger does not belong to any host, similarly to graphs.

Comment by Alexei Vladishev [ 2014 Jan 31 ]

We cannot evaluate macros differently in different context, it will be very confusing.

However I agree that we may modify event details to display all hosts there.

Comment by Ivo Kurzemnieks [ 2014 Jan 31 ]

RESOLVED in svn://svn.zabbix.com/branches/dev/ZBX-7713

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jan 31 ]

(1) The host.get request should be moved outside of the foreach loop.

iivs RESOLVED in r42064

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jan 31 ]

(2) In this row:

$table->addRow(array(_n('Host', 'Hosts', count($hostNames)), $hostNames));

You cannot use "count($hostNames)" because it will also count commas.

iivs RESOLVED in r42064

jelisejev CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jan 31 ]

(3) I've made some changes in r42067, please review.

iivs REVIEWED.
Thanks!
CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2014 Jan 31 ]

TESTED.

Please review (3) before merging.

Comment by Ivo Kurzemnieks [ 2014 Jan 31 ]

Implemented inĀ pre-2.3.0 (trunk) r42071

Comment by Oleksii Zagorskyi [ 2014 Jan 31 ]

Tested, it works !

Just a note:
Hosts will be listed there not in order as they used in expression, but looks like according to hostIDs.
It's probably ok, as expression can contain items from single host ot other mix and it's not easy to decide what order would be more logical.

Comment by Oleksii Zagorskyi [ 2014 Jan 31 ]

(4) well, probably worth to document it on 2.4_what_is_new
Or no ?

<richlv> changelog entry has been added in "new features" section. we should either move it to bugfix section or document this in whatsnew - or both.

martins-v Added to the draft of "what's new in 2.4"

zalex_ua how you did the screenshot for 2.4 ?
In expression I see host name "mnd_desk" but in hosts list it's "New host".
If you used visible host name and it's different form technical one - I believe it's better to avoid such usage in the example.
REOPENED

martins-v Well, it would have been good (even though not critical) to redo the screenshot then, but I believe now, in 2019, it's too trivial to redo, given that the main idea is described and there is actually nothing technically wrong with the screenshot. CLOSED

Comment by Oleksii Zagorskyi [ 2014 Jul 18 ]

4 is still not resolved -> REOPENED.

Generated at Sat Apr 20 16:10:07 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.