ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10466

events.php page without "hostid" parameter would not show the proper trigger

    Details

      Description

      Originally posted as comment by James Sperry 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

        Activity

        Hide
        Gunars Pujats added a comment - - edited

        (1) No translation strings changed.

        Ivo Kurzemnieks CLOSED

        Show
        Gunars Pujats added a comment - - edited (1) No translation strings changed. Ivo Kurzemnieks CLOSED
        Hide
        Gunars Pujats added a comment -

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

        Show
        Gunars Pujats added a comment - RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-10466
        Hide
        Ivo Kurzemnieks added a comment - - edited

        (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.

        Gunars Pujats RESOLVED in r58955.

        Ivo Kurzemnieks CLOSED

        Show
        Ivo Kurzemnieks added a comment - - edited (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. Gunars Pujats RESOLVED in r58955. Ivo Kurzemnieks CLOSED
        Hide
        Ivo Kurzemnieks added a comment - - edited

        (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.

        Gunars Pujats RESOLVED in r59013.

        Ivo Kurzemnieks Great! Works like a charm. Thanks!
        CLOSED

        Show
        Ivo Kurzemnieks added a comment - - edited (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. Gunars Pujats RESOLVED in r59013. Ivo Kurzemnieks Great! Works like a charm. Thanks! CLOSED
        Hide
        Gunars Pujats added a comment - - edited

        Fixed in:

        • pre-3.0.2rc1 r59049
        • pre-3.1.0 (trunk) r59050
        Show
        Gunars Pujats added a comment - - edited Fixed in: pre-3.0.2rc1 r59049 pre-3.1.0 (trunk) r59050
        Hide
        Alexander Vladishev added a comment - - edited

        (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
                        ]);
                }
        

        Gunars Pujats RESOLVED in r59049, r59050.

        Alexander Vladishev Thank you! CLOSED

        Show
        Alexander Vladishev added a comment - - edited (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 ]); } Gunars Pujats RESOLVED in r59049, r59050. Alexander Vladishev Thank you! CLOSED
        Hide
        James Sperry added a comment -

        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

        Show
        James Sperry added a comment - 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

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander Vladishev
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: