Ad Widget

Collapse

How to use {HOST.NAME} in template macro value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dbatechnologies
    Junior Member
    • Dec 2014
    • 11

    #1

    How to use {HOST.NAME} in template macro value

    So I have some macros defined on template level, like {$INSTANCE_NAME}. This macro is inherited by any host assigned to this template. But as a value I would like to put there {HOST.NAME}, so when descending to host level, this macro would contain host name already. How to do this? For now I have:
    Macro name - macro value
    {$INSTANCE_NAME} - {HOST.NAME}
    but it is not resolving to host name for the item, I can see {HOST.NAME}.
    Thanks

  • aspitzer
    Junior Member
    • Feb 2023
    • 11

    #2
    Did you ever figure this out? I am trying to get this to work too.

    Comment

    • guille.rodriguez
      Senior Member
      • Jun 2022
      • 114

      #3
      I want the same for trigger instead macro, but why do you want to use macro on host?

      If you can get the hotsname via Agent or SNMP you can use in triggers (that's the way im doing now some triggers)

      Comment

      • aspitzer
        Junior Member
        • Feb 2023
        • 11

        #4
        Originally posted by guille.rodriguez
        I want the same for trigger instead macro, but why do you want to use macro on host?

        If you can get the hotsname via Agent or SNMP you can use in triggers (that's the way im doing now some triggers)
        I have a discovery rule that finds webservers. I wanted to bulk set the MACRO {$WEB.URL} = http://{HOST.NAME} instead of having to configure each one manually.

        Comment

        • DaveL
          Junior Member
          • Nov 2018
          • 3

          #5
          I have hosts for website I'm monitoring with web scenarios. I'm adding certificate monitoring with the official template (https://git.zabbix.com/projects/ZBX/...at=release/7.2), which require the {$CERT.WEBSITE.HOSTNAME} macro manually defined. I'm trying to set it with {HOST.NAME} (which is like "example.com"), but I see an error on the item: "Invalid parameters: parse "https://{HOST.NAME}": invalid character "{" in host name", so the macro is not resolved.
          So, it seems it's the same problem as you. Nobody found something about it?

          Comment

          Working...