Ad Widget

Collapse

Zabbix - MAP - Editing the map element with macr

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • FuBa
    Junior Member
    • Oct 2025
    • 2

    #1

    Zabbix - MAP - Editing the map element with macr

    Hi, it is my 1st message, I'm new here and I searched forum for the solution but couldn't get the right answer. If there is a similar topic just help me to find.

    Here is my situation:
    I'm using 7+ version Zabbix, made all discovery, hostname and etc. I see my hosts, hostnames are OK, IP addresses perfect. Just a little nuance, coz of my devices are in a domain (for example domain.com) all my host's hostnames are like SW-1.1_Office.domain.com. This is OK for the "Hosts" section, but some names are too long and with domain.com it gets more longer. So I decided to "delete" the domain extension. What I'm trying to do just shorten the hostname of the host ON THE MAP. So what am I doing.

    1. Adding a Map Element on the map
    2. Changing it to "Host"
    3. Selecting my Host
    4. At the Label section typing {HOST.NAME} or {HOST.HOST}

    this gives me the SW-1.1_Office.domain.com. Now the question is what can I add after {HOST.NAME} or the {HOST.HOST} to delete the "domain.com" extension?
  • Answer selected by FuBa at 13-10-2025, 14:33.
    FuBa
    Junior Member
    • Oct 2025
    • 2

    I have figured out typing {{HOSTNAME}.regrepl(".domain.com","")} to the Label section.

    Comment

    • FuBa
      Junior Member
      • Oct 2025
      • 2

      #2
      I have figured out typing {{HOSTNAME}.regrepl(".domain.com","")} to the Label section.

      Comment

      Working...