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

XML Export - trigger with more then 1 host

    XMLWordPrintable

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.3
    • Fix Version/s: None
    • Component/s: Frontend (F)
    • Labels:
      None
    • Environment:
      PHP5 - Apache 2.2.x - MySQL 5.1 - Debian

      Description

      Wrong export:
      ...
      <triggers>
      <trigger>
      <description>trigger1</description>
      <expression>{{HOSTNAME}:item1.last(0)}=0 | {{HOSTNAME}:item1.last(0)}=0</expression>
      </trigger>
      </triggers>
      ...

      Right export:
      ...
      <triggers>
      <trigger>
      <description>trigger1</description>
      <expression>

      {host1:item1.last(0)}

      =0 |

      {host2:item1.last(0)}

      =0</expression>
      </trigger>
      </triggers>
      ...

      My patch on function explode_exp() in triggers.inc.php :

      902c902
      < else if(is_numeric($functionid) && $function_data = DBfetch(DBselect('select h.host,i.key_,f.function,f.parameter,i.itemid,i.value_type'.

      > else if(is_numeric($functionid) && $function_data = DBfetch(DBselect('select h.host,h.status,i.key_,f.function,f.parameter,i.itemid,i.value_type'.
      906c906
      < if( $template ) $function_data["host"] = '

      {HOSTNAME}';

      > if( $function_data["status"] == HOST_STATUS_TEMPLATE ) $function_data["host"] = '{HOSTNAME}

      ';

        Attachments

          Activity

            People

            Assignee:
            alexei Alexei Vladishev
            Reporter:
            cesare cesare montresor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: