Ad Widget

Collapse

Problems with displaying live data via macros in the label for maps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael.S
    Junior Member
    • Nov 2021
    • 3

    #1

    Problems with displaying live data via macros in the label for maps

    Hi,

    I'm testing Zabbix (6.0 alpha7 appliance) and I want to show the live data of the devices (routers) in the label on the maps.

    I have set the "Map element label type" on the maps to Label.

    I tried different syntaxes but none of them worked. Do I have an error in the syntax or do I have to adjust a setting?


    {HOST.NAME} << works
    {HOST.CONN} << works
    {{HOST.HOST}:icmppingsec.last(0)} <<< don't work
    {{HOST.HOST}:uptime.last(0)} <<< don't work

    Click image for larger version

Name:	1.png
Views:	8128
Size:	18.0 KB
ID:	435316

    I have checked the key under Latest Data, the name is correct.

    Click image for larger version

Name:	2.png
Views:	8179
Size:	22.5 KB
ID:	435317
    Thank you for your help

    Micha
  • ph30n1x
    Junior Member
    • Nov 2021
    • 2

    #2
    I can also confirm the following do not work in Zabbix 6.0 alpha7 appliance

    {{HOST.NAME}:icmppingsec.last(0)}
    {{HOST.NAME}:net.if.in[ifHCInOctets.2].last(0)}
    {{HOST.NAME}:net.if.in[ifHCOUTOctets.2].last(0)}
    {{HOST.NAME}:net.if.speed[ifHighSpeed.2].last(0)}

    Comment

    • ticozabbix
      Junior Member
      • Nov 2021
      • 1

      #3
      Hi guys!

      I am using the Zabbix 5.4 appliance and I am also having difficulty displaying the label values on the map. When I try to put the values below on the label of the link between two switches on my network:

      {{HOST.NAME}:net.if.in[ifHCInOctets.1].last(0)} -> Doesn't work!
      {{HOST.NAME}:net.if.in[ifHCOUTOctets.2].last(0)} -> Doesn't work!

      Could anyone let us know if anything changed in Zabbix from version 5.4 appliance to macro settings on labels? Or would that be some BUG?

      Thanks in advance.

      Comment

      • ph30n1x
        Junior Member
        • Nov 2021
        • 2

        #4
        Looks like this is not going to get fixed in V6 any time soon if its a problem in the production version (5.4)

        Comment

        • renanredel
          Junior Member
          • Feb 2022
          • 2

          #5
          Hi guys,

          I'm facing the same problem.
          Any fix?

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            If you want to display a value of item, then use its real name there not a macro.
            Like
            Code:
            {HOST.NAME}
            Agent {Zabbix server:zabbix[host,agent,available].last(0)}
            So, for topic starter
            Code:
            {HOST.NAME} 
            {HOST.CONN}
            {LC_EDULeipzig:icmppingsec.last(0)}
            {LC_EDULeipzig:uptime.last(0)}
            @ticozabbix
            replace macros with real names in those link labels and it should work. While rendering link labels, it is unclear otherwise, which hosts IF data should be used.

            Comment


            • ticozabbix
              ticozabbix commented
              Editing a comment
              I tried doing this, but it didn't work. Anyway, thanks for your help. I believe it is some bug.
          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #7
            Originally posted by amanda9nunes
            Zabbix 5.4 release comes with scheduled PDF report generation, robust problem detection, advanced data aggregation, and other significant improvements. Get a quick overview of the most notable features available in the new version.
            Oh really? Tell us more...

            Comment

            • renanredel
              Junior Member
              • Feb 2022
              • 2

              #8
              Originally posted by cyber
              If you want to display a value of item, then use its real name there not a macro.
              Like
              Code:
              {HOST.NAME}
              Agent {Zabbix server:zabbix[host,agent,available].last(0)}
              So, for topic starter
              Code:
              {HOST.NAME}
              {HOST.CONN}
              {LC_EDULeipzig:icmppingsec.last(0)}
              {LC_EDULeipzig:uptime.last(0)}
              @ticozabbix
              replace macros with real names in those link labels and it should work. While rendering link labels, it is unclear otherwise, which hosts IF data should be used.
              I'm doing exacly that.
              See the attachments:

              Has any way of fix this ?
              Attached Files

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4807

                #9
                Everything I wrote, works for me with 4.4 and with 5.0. I have no newer versions installed. But docs are same for them, so I have no doubts, that it works on newer ones also.

                There is "expand macros" option in map editing mode, it will expand macros also in edit mode

                Click image for larger version

Name:	expand.png
Views:	7887
Size:	7.9 KB
ID:	439020

                and you are trying to show ifINOctets item, but your last part of pic shows IfINUcastPkts. I know it may seem like a bit of trolling, but sometimes people really miss obvious things.. Eventho, it should then display *UNKNOWN* on label...

                Comment

                • Hamardaban
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • May 2019
                  • 2713

                  #10
                  Version 6 has a different syntax {?last(/host/key)}

                  Comment


                  • cyber
                    cyber commented
                    Editing a comment
                    Stupid me, forgot that syntax change again....

                  • renanredel
                    renanredel commented
                    Editing a comment
                    Thanks you!
                    I was reading the documentation from 5.4. .

                  • ticozabbix
                    ticozabbix commented
                    Editing a comment
                    This new syntax worked for me in version 6 and I decided to test it in version 5.4 and it also worked. Thanks!
                • cezar.cintea
                  Junior Member
                  • Oct 2022
                  • 1

                  #11
                  Hello ticozabbix,
                  Can you share the new used syntax?

                  Comment

                  • engrnauman
                    Junior Member
                    • Jul 2023
                    • 1

                    #12
                    Hello.
                    I'm stuck in this problem. I don't know what to do. I'm unable to solve this puzzle. please help me about syntax or something else.Click image for larger version

Name:	1.jpg
Views:	4850
Size:	15.6 KB
ID:	466962

                    Comment


                    • Oleksandr Denesyuk
                      Oleksandr Denesyuk commented
                      Editing a comment
                      Hello.
                      Put a question mark before last, for example:
                      In: {?last(/TF_SW1_A/net.if.in[ifHCInOctets.59])}
                  Working...