Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-7212

Host interface macros are resolved incorrectly in script confirmations

    Details

      Description

      Host interface priorities are not taken into account when resolving interface-related macros. Here's how you can reproduce the problem:
      1. Create a script that uses a

      {HOST.IP}

      macro in its confirmation text.
      2. Create a host with a JMX interface.
      3. Save the host.
      4. Add a SNMP interface to that host.
      5. Execute the script.
      The confirmation text will contain the IP of the JMX interface, even, thought the SNMP interface has a higher priority.

      The problem is caused by the following code in CMacrosResolver.php:240:

      $dbInterfaces = DBselect(
      'SELECT i.hostid,i.ip,i.dns,i.useip,i.type'.
      ' FROM interface i'.
      ' WHERE i.main='.INTERFACE_PRIMARY.
      ' AND '.dbConditionInt('i.hostid', $hostIds).
      ' AND '.dbConditionInt('i.type', $this->interfacePriorities)
      );

      Not only doesn't it sort interfaces by priority, but it tries to filter interface types using priority values.

      I suggest to fix this problem after ZBX-7137 is finished.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jelisejev Pavels Jelisejevs (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: