Ad Widget

Collapse

Problem with LLD Macro Resolution in Item Prototype

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Roxo92
    Junior Member
    • Mar 2021
    • 15

    #1

    Problem with LLD Macro Resolution in Item Prototype

    Hello everyone,
    I'm a new Zabbix user, so I may have made basic configuration errors.

    I'm encountering an issue while creating a Zabbix template with discovery rules. I've configured a discovery rule that correctly returns data (During the test), including values for LLD macros. However, when I use these macros in item prototypes, the values are not resolved correctly.

    Details:
    • Zabbix Version: 7.0.11
    • Operating System: Ubuntu 24.04
    • Discovery Rule Description: Discovery Interface
    • LLD Macro Example: {#QNAP.IFNAME}
    • JSONPath: $.qnap.ifname
    • Item Prototype Example: qnap.bits.received.[{#QNAP.IFNAME}

    Has anyone encountered a similar problem or have any suggestions on how to resolve it? Any help is greatly appreciated. Thanks in advance.
    Attached Files
  • mrnobody
    Member
    • Oct 2024
    • 61

    #2
    Hi,

    There is different types of macros (check documentation), QNAP.IFNAME is an custom macro, you created it, so the right syntax is {$QAP.IFNAME}, use $ instead of #, it's reserved for built in macros like {#SNMPVALUE}

    Comment


    • mrnobody
      mrnobody commented
      Editing a comment
      Not built in, LLD* macro, as cyber said ^^
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #3

    Originally posted by mrnobody
    Hi,

    There is different types of macros (check documentation), QNAP.IFNAME is an custom macro, you created it, so the right syntax is {$QAP.IFNAME}, use $ instead of #, it's reserved for built in macros like {#SNMPVALUE}
    He has no use of user macros in LLD... Besides built-in macros have no $ or #... those are for user and LLD macros..
    most of it there is OK.
    I think you are mixing up some things here... You are doing discovery over SNMP, there you already get values for your lld macro, you dont need to have any preprocessing with jsonpath, as you already have LLD macros formatted in that output data (https://www.zabbix.com/documentation...ples/snmp_oids). With pointing a macro to non-existent place it does not get any value and gets treated literally later and you will end up with that "already exists" error, as LLD macro value doe not get changed if loop over snmpindex...

    Comment

    • Roxo92
      Junior Member
      • Mar 2021
      • 15

      #4
      Originally posted by cyber


      He has no use of user macros in LLD... Besides built-in macros have no $ or #... those are for user and LLD macros..
      most of it there is OK.
      I think you are mixing up some things here... You are doing discovery over SNMP, there you already get values for your lld macro, you dont need to have any preprocessing with jsonpath, as you already have LLD macros formatted in that output data (https://www.zabbix.com/documentation...ples/snmp_oids). With pointing a macro to non-existent place it does not get any value and gets treated literally later and you will end up with that "already exists" error, as LLD macro value doe not get changed if loop over snmpindex...
      Thank you very much for your support and the helpful tip.
      By using the values {#SNMPVALUE} and {#SNMPINDEX}, I was able to successfully create the discoveries for the templates I built.

      Comment

      Working...