Ad Widget

Collapse

macro function as macro value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MopedHelena
    Junior Member
    • Sep 2024
    • 5

    #1

    macro function as macro value

    Hi!

    I'm monitoring Tomcats via jmx. Further I want to add some web scenarios to the same host. On our old Zabbix installation I made a bunch of macros in a template for the web scenarios and had to adjust some (e.g. domain, port, etc.) of the macros at host level for each new host.

    Since all of our Tomcats follow a specified scheme I actually could build all necessary values from {HOST.HOST} and {HOST.PORT} with Macro functions in the template for the web scenarios. Eg. the host part of a FQDN is a substring of {HOST.HOST}.

    But Macros do not accept Macro functions as values. Do you have an advice how to solve this to reduce the amount of effort to add new hosts?

    Regards

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

    #2
    But if you ditch the user macro? instead of doing {$MACRO}=value and then using that {$MACRO} in item key parameters, write to key parameters "{HOST.NAME}.regsub(<your regex>)" .. HOST.NAME is usable in item key parameter, thus it accepts macro functions... HOST.PORT unfortunately cannot be used in key parameters..

    Comment

    Working...