Ad Widget

Collapse

Zabbix maps max label size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sepsisko
    Junior Member
    • Sep 2017
    • 1

    #1

    Zabbix maps max label size

    Hello Zabbix community,

    i have a quick question about the max label size in maps. I updated our Zabbix server to the new 3.4 version and now our max label size is default again. I wanted to change the size of the labels in the php files again, but I cannot find the line nor the file where to change this.

    Can someone tell me which file I have to edit for this?
  • ESDadmin
    Junior Member
    • Oct 2017
    • 5

    #2
    I would really like to find this out as well. I've been looking all over the forums and the zabbix feature requests to no avail. There's been plenty of talk about this over the years and even some patches that people have created to change some of the inc.php files. However, those were all written for a version of Zabbix that existed about six years ago at this point. Any instructions that I follow don't lead anywhere.

    There's got to be a somewhat simple change we can make somewhere to increase the label size on maps, right?

    I appreciate any help!

    Comment

    • gmanual
      Junior Member
      • Oct 2008
      • 10

      #3
      /usr/share/zabbix/js/vector/class.svg.map.js

      There are various 'font-size' set in the file, edit, and refresh browser.

      Comment

      • ysus
        Senior Member
        • Mar 2016
        • 100

        #4
        In version 4.0.1 you need to edit line 929 of /usr/share/zabbix/js/vector/class.svg.map.js

        Code:
               this.element.add('textarea', {
                                x: options.center.x,
                                y: options.center.y,
                                fill: '#' + this.map.options.theme.textcolor,
                                'font-size': '10px',
                                'stroke-width': 0,
                                anchor: {
                                        horizontal: 'center',
                                        vertical: 'middle'
                                },
                                background: {
                                }
                        }, options.label
                );

        Comment

        • andreaszaia
          Junior Member
          • May 2021
          • 2

          #5
          Well, i had a problem like that

          Solved by change the 20 to 100 in line 1426 and 1427 on file '/usr/share/zabbix/include/items.inc.php'

          Comment

          • markfree
            Senior Member
            • Apr 2019
            • 868

            #6
            Originally posted by andreaszaia
            Well, i had a problem like that

            Solved by change the 20 to 100 in line 1426 and 1427 on file '/usr/share/zabbix/include/items.inc.php'
            That works great.
            Nowadays it is line 1453 and 1454.

            Code:
            if ($trim && mb_strlen($value) > 20) {
                $value = mb_substr($value, 0, 20).'...';
            }
            I just switched the value from 20 to 38 so I could fit an IPv6 address.

            Comment

            Working...