Ad Widget

Collapse

grpavg for discovered hosts with templated checks?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GeoffE
    Junior Member
    • Nov 2015
    • 12

    #1

    grpavg for discovered hosts with templated checks?

    (this is a question for Zabbix 2.4.6)

    I'm trying to set up a group average for a cluster of hosts that we've added via low-level discovery. Thost hosts have various Zabbix agent checks added from the discovery template that look like this:
    Code:
    get_stuff[{HOST.HOST},foo,bar]
    What I want to be able to do is set up an item on our aggregate "host" that does something like this:
    Code:
    grpavg["Discovered Hostgroup","get_stuff[{HOST.HOST},foo,bar]",last,0]
    Obviously, this doesn't work - because it replaces {HOST.HOST} with the aggregate's hostname.

    I've got a workaround, whereby the template has each host create kind of a "shadow copy" of the data, using a calculated value - with a static key:
    Code:
    Calculated: last("get_stuff[{HOST.HOST},foo,bar]",last,0]")
    Key:  stuff.data
    This lets me do this:
    Code:
    grpavg["Discovered Hostgroup","stuff.data",last,0]
    And this works just fine. But it seems rather of an inefficient and hack-y way of doing it.

    Is there an obvious method to do a group function on a templated check like that that I'm missing?

    EDIT: I should clarify that the reason that {HOST.HOST} is in the templated check is because it is actually pulling from an ElasticSearch installation (running on another host entirely). The check passes the hostname as part of that.
    Last edited by GeoffE; 02-12-2015, 20:02. Reason: Clarification.
Working...