Ad Widget

Collapse

Correct way to pass LLD parameters to action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JureSah
    Junior Member
    • Aug 2021
    • 9

    #1

    Correct way to pass LLD parameters to action

    Hello,

    I have a simple setup where Discovery creates an item and a trigger with a single parameter: {#USERNAME} .

    I wanted to attach an action to this, which passes this {#USERNAME} of course resolved to an external API using curl. Unfortunately this did not work as the macro did not resolve. I'm using 5.0 and https://www.zabbix.com/documentation...ed_by_location clearly lists LLD macros, but it does not work?

    I worked around the issue by putting {#USERNAME} in the trigger description and then using {TRIGGER.DESCRIPTION} in my action code and this works fine.

    But this is a bit of a hack. How is this done correctly?

    LP,
    Jure
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    LLD macros are resolved to a discovered things during discovery, after that, they do not exist... So trying to pass something along, it needs to be stored somewhere, where you can refer to it by some other built-in macro, like you did with trigger description. So it is not really a hack.. More common way to do it, would be the use of tags for this. Setting a value to a tag and later refer to it with {EVENT.TAGS.<tag name>} macro.
    {EVENT.TAGS.<tag name>} → Trigger-based notifications and commands
    → Problem update notifications and commands
    → Webhook media type URL names and URLs

    Comment

    • JureSah
      Junior Member
      • Aug 2021
      • 9

      #3
      Thanks, this works and looks much better.

      LP,
      Jure

      Comment

      Working...