[ZBX-10466] events.php page without "hostid" parameter would not show the proper trigger Created: 2016 Feb 29  Updated: 2017 May 30  Resolved: 2016 Mar 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.4.7, 3.0.1
Fix Version/s: 3.0.2rc1, 3.2.0alpha1

Type: Incident report Priority: Major
Reporter: Alexander Vladishev Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: events
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Originally posted as comment by ejames in ZBX-10362 .

events.php?triggerid={TRIGGER.ID}&filter_set=1 without hostid parameter would not show the proper trigger.

According documentation hostid parameter is not required



 Comments   
Comment by Gunars Pujats (Inactive) [ 2016 Mar 04 ]

(1) No translation strings changed.

iivs CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 Mar 04 ]

RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10466

Comment by Ivo Kurzemnieks [ 2016 Mar 09 ]

(2) Changing source to Discovery and having an URL with triggerid and filter_set, shows no data. It should switch back to source Triggers. We should automatically detect it and change it.

gunarspujats RESOLVED in r58955.

iivs CLOSED

Comment by Ivo Kurzemnieks [ 2016 Mar 09 ]

(3) Please, check the following places where events.php is called:

  • blocks.in.php: 749 unused parameter show_unknown=1 and hostid is not required any more. Also if we fix (2), the source is no longer required too.
  • menupopup.js: 609 has groupid and hostid, and source. Should be enough with triggerid and filter_set now. Probably we could remove SID too.
  • report2.php: 389
    Other places like inventory.host.view and search.php the links seem to be correct, since they do not use triggerid, but mainly just set group, host and source, so all triggers can be viewed.

gunarspujats RESOLVED in r59013.

iivs Great! Works like a charm. Thanks!
CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 Mar 16 ]

Fixed in:

  • pre-3.0.2rc1 r59049
  • pre-3.1.0 (trunk) r59050
Comment by Alexander Vladishev [ 2016 Mar 16 ]

(4) Seems this code is not used after this fix

frontends/php/include/maps.inc.php:146:164

         // Find monitored hosts and get groups that those hosts belong to.
        $monitored_hostids = [];

        foreach ($triggers as $trigger) {
                foreach ($trigger['hosts'] as $host) {
                        if ($host['status'] == HOST_STATUS_MONITORED) {
                                $monitored_hostids[$host['hostid']] = true;
                        }
                }
        }

        if ($monitored_hostids) {
                $monitored_hosts = API::Host()->get([
                        'output' => ['hostid'],
                        'selectGroups' => ['groupid'],
                        'hostids' => array_keys($monitored_hostids),
                        'preservekeys' => true
                ]);
        }

gunarspujats RESOLVED in r59049, r59050.

sasha Thank you! CLOSED

Comment by James Sperry [ 2016 Apr 22 ]

Is this supposed to work with only <zabbix url>/events.php?triggerid=

{TRIGGER.ID}

Because it's still going to the wrong host unless I have <zabbix url>/events.php?triggerid={TRIGGER.ID}

&filter_set=1

Currently we're on 2.2, and we only use <zabbix url>/events.php?triggerid=

{TRIGGER.ID}

which works fine.

Moving forward, if we need to include filter_set, then I'll update all my triggers during my upgrade to 3.0.2

Generated at Thu Apr 25 23:07:07 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.