Ad Widget

Collapse

Reading Host Tag value from manual Zabbix script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evgenys
    Junior Member
    • Apr 2015
    • 7

    #1

    Reading Host Tag value from manual Zabbix script

    Hi

    I am trying to run the Zabbix script from GUI when pointing to some host.
    The problem is that I can't really get the host tag value when manually running my script.

    I used this topic for reference and tried several options like:
    {HOST.TAGS.<name>}
    {EVENTS.TAGS.<name>}

    {HOST.HOST} does work fine ...

    Is there any way for doing that?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    There is no such macros as {HOST.TAGS.<name>} or {EVENTS.TAGS.<name>}. There is {EVENT.TAGS.<tag name>}

    What is it you are trying to do actually? .. What you want to achieve?

    Comment

    • evgenys
      Junior Member
      • Apr 2015
      • 7

      #3
      I want to trigger a gitlab pipeline that will run on a specific host, I need to supply two variables: hostname and specific tag value (datacenter name in my case)

      Comment

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

        #4
        You are not specifying here, what version you are using... I'll go by latest... older ones do not have such "scope" option at all...


        Pay attention to "Scope" and Macro support there.
        If you go from there to https://www.zabbix.com/documentation...ed_by_location as suggested, then you can see, that {HOST.*} macors can be used in Host Actions, but anything related to tags is not available there. But a lot more is available for "event actions".

        So... in (my) conclusion, you cannot really have a "host action" based on tags, but you can have a "event action", which you can trigger from the menu of event ... But this requires you to have somekind of event triggered to execute it....

        Eventho... if tags are currently supported on host level, this could be available, maybe needs someone to rise a dev request for this?

        Comment

        Working...