Ad Widget

Collapse

Can a template macro be created based on item data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mislav
    Junior Member
    • Mar 2019
    • 4

    #1

    Can a template macro be created based on item data?

    I would like to monitor various aspects of a particular application that is running on multiple hosts. The application install path will not be the same on all hosts.

    I am able to retrieve the install path from the Windows registry using a System.run item.

    I would like to create a user macro at the template level and have the macro value be set to the install path retrieved from the System.run item. This way, the macro value will be correct for each host that is being monitored.

    Is something like this possible? Or will I have to override this template macro at the host level and hardcode the install path there; i.e. I'd need to do this manually for each host?
  • brunohl
    Senior Member
    Zabbix Certified Specialist
    • Mar 2019
    • 215

    #2
    Hey,

    From what I've seen in the docs and tried on my server I think that's not possible.

    I thought to use Inventory (which can be autofilled), but it's no use (https://www.zabbix.com/documentation...ed_by_location).

    The only ways that I see you doing this is with:
    1 - Using Zabbix API to change Macro values => Which I don't think it's a good idea in this case
    2 - Using a Low-Level-Discovery, so you use one key to find all the variables you want and then create itens automatically. => Which I think is the best case scenario.

    Comment

    • mislav
      Junior Member
      • Mar 2019
      • 4

      #3
      Thanks brunohl, I appreciate the response. I like option #2, so I think I'll give that a go.

      Comment

      • brunohl
        Senior Member
        Zabbix Certified Specialist
        • Mar 2019
        • 215

        #4
        Yeah, I would advise you strongly to do that. LLD can be used for so many things...

        Comment

        Working...