Ad Widget

Collapse

Calculated group item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cdslaughter
    Member
    • Jun 2018
    • 69

    #1

    Calculated group item

    I am trying to create an item that is the sum of all the item X values for every host in a specific group.
    As an example.
    I have an agent check for "perf_counter[\DNS\Total Query Received]" for all the hosts in the group called "DNS"
    On each host, I have a calculated item using this formula "change(perf_counter[\DNS\Total Query Received])"

    What I was hoping to find is some sort of calculated item where the formula might look something like "
    change(Group_Name:Item_key[])"
    maybe
    For example:
    change(DNSerf_counter[\DNS\Total Query Received])


    Am I missing it maybe? I am trying to avoid making a calculates metric using sum where I have to manually update it every time I add or remove a host from the DNS group.

    Carl
  • cdslaughter
    Member
    • Jun 2018
    • 69

    #2
    So has anyone come up with any ideas on how this can be done?

    The reason for this specific type of check is to allow the use of a template when adding new servers to a cluster without having to manually update this metric.

    Like when dynamically adding new web, app, or DB servers to a cluster. I have set it up so that when one of those new servers comes up, it gets the correct templates added and assigned to the correct groups.

    If there is not a way to do this currently, is there a place where I can make that suggestion?

    Thank you,
    Carl Slaughter
    Network Systems Engineer
    IBM Cloud (SoftLayer)
    Managed Services

    Comment

    • kloczek
      Senior Member
      • Jun 2006
      • 1771

      #3

      You need to use grpsum() function and put all those host in the same group.
      http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
      https://kloczek.wordpress.com/
      zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
      My zabbix templates https://github.com/kloczek/zabbix-templates

      Comment

      • cdslaughter
        Member
        • Jun 2018
        • 69

        #4
        Thank you! I will see if I can get that working.

        Comment

        • cdslaughter
          Member
          • Jun 2018
          • 69

          #5
          I am looking at the doco and I don't see how to specify which group it should be using in the sum function..
          A search only sends me back to the same link and provides no additional explanation.


          Carl

          Comment

          • kloczek
            Senior Member
            • Jun 2006
            • 1771

            #6
            In each host in the group should be the same item added for example by template.
            If such item on each host is about some requests counters such item should have in the filter "speed per second". It those counters are rotating or may be reset time to time this would allow minimise impact of those resets.
            Than you should create something which is called dummy host which name could be assembled like (for example) DNS-<grp_name>.
            Dummy host it is host which in host interface has localhost/127.0.0.1 (you can have as many such dummy hosts as you want).
            On such dummy host you can add item or group metrics template which will contain only calculated items using functions from the page https://www.zabbix.com/documentation...ypes/aggregate
            If you have more groups of DNS servers you can write group template which which will be doing sums/avgs per macroed group of hosts.
            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
            https://kloczek.wordpress.com/
            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
            My zabbix templates https://github.com/kloczek/zabbix-templates

            Comment

            • Rudlafik
              Senior Member
              • Nov 2018
              • 144

              #7
              Hi resolution is:
              1. set calculated Item
              2. set valid "Type of information"
              3.The most important rule: EVERY HOSTS in HostGroup MUST have ITEM KEY in them item catalog same which is in Aggregate calculations Formula. Else you get error on end test formula.

              example:

              If you would like count sum all enable items all hosts in specific host groupe, than use calculated item with formula: sum(last_foreach(/*/zabbix[host,,items]?[group="HostGroup"])) and add item zabbix[host,,items] to each host in hostgroup.​

              Comment

              Working...