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

Mapping value incorrect

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.8.1
    • 1.8.1
    • None
    • None
    • apache-2.2.3-11,php-5.1.6, MySQL 5.0.45

      When access to Overview screen with View Data mode,
      The mapping value (eg: Host status: Up (0)) is incorrect, it always get the string of previous host.
      I debugged in the web source code and find the problem in function replace_value_by_map (at /php/include/config.inc.php)
      It should be fixed as following:
      function replace_value_by_map($value, $valuemapid){
      if($valuemapid < 1) return $value;

      static $valuemaps = array();
      if(isset($valuemaps[$valuemapid][$value])) return $valuemaps[$valuemapid][$value];

      $sql = 'SELECT newvalue '.
      ' FROM mappings '.
      ' WHERE valuemapid='.$valuemapid.
      ' AND value='.zbx_dbstr($value);
      $result = DBselect($sql);
      if($row = DBfetch($result))

      { $valuemaps[$valuemapid][$value] = $row['newvalue'].' '.'('.$value.')'; return $valuemaps[$valuemapid][$value]; }

      return $value;
      }

            Unassigned Unassigned
            dusito Tran Anh Nhan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: