Ad Widget

Collapse

Zabbix user macros in media type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • liedekef
    Junior Member
    • May 2005
    • 10

    #1

    Zabbix user macros in media type

    I have a custom media type (script) that accepts a number of parameters. One of them is some info on a location (country-like), so I created a global macro:
    {$CELL_NAME} with a default value (which I can then override per host).
    Now the issue is in the script executed by the trigger (media type) to create alerts: it seems it doesn't resolve this global macro when I "test" the newly created media type, but instead it seems to literally pass "{$CELL_NAME}" to my custom script. Is this not supported?
  • Hugh
    Junior Member
    • Dec 2019
    • 3

    #2
    Same issue for me !.... Zabbix v 4.2..... any update please ?

    Comment

    • Scott75
      Junior Member
      • Dec 2019
      • 6

      #3
      I am having a similar issue. I am working on a Webhook media type, and have several variables that need to be defined from macros in order to have it create tickets in my PSA; however, none of the user defined macros resolve properly. As part of the operation I'm using two built in macros as well ({ALERT.SUBECT} and {ALERT.MESSAGE}) which do resolve properly...so this seems to be an issue primarily related to user defined macros.

      I was really hoping to use them, as I can setup global macros for my PSA, and then asset-specific macros in each Zabbix host and have all the needed information readily available, but there seems to be limitations here...

      I'm running Zabbix 4.4 (was just built 16 December using Ubuntu packages).

      Comment

      • AvaTTaR
        Member
        • Dec 2018
        • 96

        #4
        You can use {INVENTORY.ALIAS} and other(https://www.zabbix.com/documentation...ed_by_location) witch supports "Trigger-based notifications and commands"

        Comment

        • Scott75
          Junior Member
          • Dec 2019
          • 6

          #5
          Originally posted by AvaTTaR
          You can use {INVENTORY.ALIAS} and other(https://www.zabbix.com/documentation...ed_by_location) witch supports "Trigger-based notifications and commands"
          Thank you...that will get the job done. I needed to pass several paramaters, so I put them in a JSON formatted string in the INVENTORY.NOTES macro and am parsing that particular element of "value" a second time...

          Appreciate your assistance!

          Comment

          Working...