Ad Widget

Collapse

Get one host from group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trta
    Junior Member
    • Jul 2010
    • 18

    #1

    Get one host from group

    I have several hosts in a hostgroup, caled CLUSTER1. For another (probably calculated) item I need one host from that group and apply another checks. Something like last(last_foreach(/*/agent.hostname?[group="CLUSTER1"])) or so. My imagine is that simillar formula gives me string(hostname) that i use in another place. Is there some way how to achive this please?
  • Glencoe
    Zabbix developer
    • Oct 2019
    • 152

    #2
    Your question is not entirely clear. You can't use aggregated calculations on string values (agent.hostname returns string). If you need to refer to a single host from a calculated item you can just refer to that specific host /host/item from the expression.

    Comment

    • trta
      Junior Member
      • Jul 2010
      • 18

      #3
      Thank you, but this is not exactly what i need. I try to explain it in a better way.

      I have host group called CLUSTER1. On each hosts of this group I monitor (for ex.) icmpping (or "agent.ping"). My idea is to get (randomly) one host from this group which is available by icmmping (or agent.ping) and then for this one host make another different check, for example perform some "http agent" check.​
      Last edited by trta; 06-02-2023, 14:09. Reason: typo in word

      Comment

      • Glencoe
        Zabbix developer
        • Oct 2019
        • 152

        #4
        I don't think something like this (randomness) is possible out of the box. If you need some sort of conditional checks depending on what the ping result is you can either run scripts on actions or you can add some JS in preprocessing steps.

        Comment

        Working...