Ad Widget

Collapse

Problem showing full value on map label

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • s.gasca
    Junior Member
    • Aug 2019
    • 22

    #1

    Problem showing full value on map label

    Hi,

    I have done a Map Element where my label uses macro to show an Interface Name and hardware Model of a Network Switch.

    Click image for larger version  Name:	zabb1.JPG Views:	0 Size:	30.8 KB ID:	434117
    it works for interface number 1/0/1 to 1/0/9 but when i have a value 1/0/10 i have 1/0/1...
    Also for the hardware model i don't have the full value also finishing with ...
    Click image for larger version  Name:	zabb2.JPG Views:	0 Size:	17.2 KB ID:	434118

    How can i have the full text value ?

    Thanks.
  • niveastn
    Member
    • Oct 2021
    • 82

    #2
    Hey there.

    Natively I dont think you can, but maybe the workarounds in this other forum post can help you https://www.zabbix.com/forum/zabbix-...max-label-size

    Comment

    • s.gasca
      Junior Member
      • Aug 2019
      • 22

      #3
      Thanks a lot i found it on '/usr/share/zabbix/include/items.inc.php'

      change 20 to 100 on this part :

      Code:
       // apply value mapping
      switch ($item['value_type']) {
      case ITEM_VALUE_TYPE_STR:
      $mapping = getMappedValue($value, $item['valuemapid']);
      // break; is not missing here
      
      case ITEM_VALUE_TYPE_TEXT:
      case ITEM_VALUE_TYPE_LOG:
      if ($trim && mb_strlen($value) > 20) {
      $value = mb_substr($value, 0, 20).'...';
      }
      
      if ($mapping !== false) {
      $value = $mapping.' ('.$value.')';
      }
      
      break;
      
      default:
      $value = applyValueMap($value, $item['valuemapid']);
      }
      
      return $value;
      }

      Comment

      Working...