Ad Widget

Collapse

Using grpsum in a calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nleaman
    Member
    • May 2010
    • 35

    #1

    Using grpsum in a calculation

    How do I go about creating a calculated item that references aggregate items

    For example, to create a calculated item whose result is all mail storage utilization (%) for all hosts in the "Mail Storage Hosts" hostgroup, this is what I tried:

    100*last("grpsum["Mail Storage Hosts","mail.storage.used","last","0"]")/last("grpsum["Mail Storage Hosts","mail.storage.total","last","0"]")

    ...but it doesn't like that syntax. The goal is to only use hostgroups to specify hosts, and not hardcode host names into the calculation.

    I feel like I am just missing something obvious.
  • Tractorboy
    Member
    • Oct 2010
    • 98

    #2
    A few things to try

    Try

    grpsum["Mail Storage Hosts","mail.storage.used","last","0"]
    and
    grpsum["Mail Storage Hosts","mail.storage.total","last","0"]

    on there own first

    if they are ok then go

    100 * grpsum["Mail Storage Hosts","mail.storage.used","last","0"] / grpsum["Mail Storage Hosts","mail.storage.total","last","0"]

    and see what happens

    Comment

    • nleaman
      Member
      • May 2010
      • 35

      #3
      Originally posted by Tractorboy
      Try

      grpsum["Mail Storage Hosts","mail.storage.used","last","0"]
      and
      grpsum["Mail Storage Hosts","mail.storage.total","last","0"]

      on there own first

      if they are ok then go

      100 * grpsum["Mail Storage Hosts","mail.storage.used","last","0"] / grpsum["Mail Storage Hosts","mail.storage.total","last","0"]

      and see what happens
      Doesn't seem to work:

      Code:
      26350:20111128:161404.095 Item [Mail Storage:mail.storage.global.utilization] became not supported: Format error or unsupported operator. Exp: [grpsum["MailStorageHosts","mail.storage.used","last","0"]]
      The Zabbix aggregate it's referring to works fine and has plenty of values. It doesn't seem like grpsum[] can be used in a calc item.

      Comment

      • Tractorboy
        Member
        • Oct 2010
        • 98

        #4
        GrpSum

        I do not have any issues with grpsum, so is the format of your key possibly the issue? I am assuming you are storing numeric data?

        I assume this calculated item is being stored in the database?

        I'd like to have someone input further on this as it does seem strange.

        Comment

        • nleaman
          Member
          • May 2010
          • 35

          #5
          Originally posted by Tractorboy
          I do not have any issues with grpsum, so is the format of your key possibly the issue? I am assuming you are storing numeric data?

          I assume this calculated item is being stored in the database?

          I'd like to have someone input further on this as it does seem strange.
          Yes it is all numeric data. The calculated item is not being stored in the database... the aggregated value is and I'm trying to create a calculated item that uses the aggregated items (which are successfully stored in the database) as inputs into the calculated item.

          zabbix version 1.8.6
          Last edited by nleaman; 04-01-2012, 01:46. Reason: added zabbix version

          Comment

          • Pada
            Senior Member
            • Apr 2012
            • 236

            #6
            Have you managed to get it working yet.

            I've also had issues with a calculated item using aggregate items in its equation.

            There was 2 reasons why mine didn't work at first:
            1. I used grpsum[...] instead of last("grpsum[...]")
            2. I used keys within the grpsum function that didn't exist as aggregate items on that host


            So to get yours working, make sure that you've added aggregated items for:
            • grpsum["Mail Storage Hosts","mail.storage.used","last","0"]
            • grpsum["Mail Storage Hosts","mail.storage.total","last","0"]


            And then your calculated item should look like follow:
            100 * last("grpsum[\"Mail Storage Hosts\",\"mail.storage.used\",\"last\",\"0\"]") / last("grpsum[\"Mail Storage Hosts\",\"mail.storage.total\",\"last\",\"0\"]")

            Take note that I escaped the " within the grpsum function, and that I made use of the last() function with the grpsum as an argument for it.

            Comment

            • nleaman
              Member
              • May 2010
              • 35

              #7
              ahh. I will try that.

              Comment

              Working...