Ad Widget

Collapse

Sum Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rob_
    Junior Member
    • Jul 2011
    • 5

    #1

    Sum Items

    Hello Community,

    i'm new here and quiet new with zabbix.

    I would like to create an item which is a summation of an other item.

    Example.

    Item1, key=[item_xy], is a normal Zabbix_Trapper item.
    An Integer with a normal Interval.

    And i would like to have another item which is the summation of item1.
    So I created item_xy_amount as a Calculated Item.
    With formula: sum("item_xy") or sum(item_xy) or item_xy.sum() and so on....

    Can anybody understand me! Or help me?
    Or is another way possible to solve my problem.

    Million regards...
  • 0siris
    Member
    Zabbix Certified Specialist
    • Nov 2010
    • 76

    #2
    Hi there, you don't have to be quiet, I'm loud as well
    Is this what you're looking for?
    [edit] Oh wait, got your problem I think. I'll try to explain by a calculated item I made earlier:

    Description: calculated CPU load
    Type: Calculated
    Key: system.cpu.calculatedload
    Formula: last("system.cpu.load[,avg1]")/last("system.cpu.lcpu")

    This "system.cpu.lcpu is a user parameter, but you get the point: I divide the last received value of cpu load by the last received value of another parameter.

    In your case: perhaps you should use the "+" operator instead of the "/" I used.

    Hope this helps.
    Last edited by 0siris; 19-07-2011, 17:03.

    Comment

    • Rob_
      Junior Member
      • Jul 2011
      • 5

      #3
      @0siris

      Thanks for your fast reply.

      I don't understand why the function sum() doesn't work.
      I always get the error that key is not supported or "key" cannot be evaluated.

      I would like to have an item which is the sum of an other item.

      I will test your example.

      Thanks for that.

      Comment

      • Rob_
        Junior Member
        • Jul 2011
        • 5

        #4
        Greetz,

        i finally found a solution and my problem.

        So:

        I've created an item with the key: 'item1'.
        This item is filled with data(Integer values) every 5 Minutes.

        I've created another item with key 'item1_amount'.
        The second item should be a summantion of item one.
        So i declared the second item with the type 'calculated'.
        The formula for this item is: sum("item1", 2592000)

        The 2592000 is one month in seconds. This means that item1_amount sums all items that are younger then 1 month.
        Edit:
        My problem was that i specified a wrong parameter2 for the sum function.

        Problem solved.

        Comment

        • Fotis
          Junior Member
          • Sep 2014
          • 24

          #5
          Help is needed !

          Hello there, I would like your help on a similar issue.
          I want to check if a process is alive. So, I created the following calculated item.

          last("proc.num[Tomcat7.exe]")+last("proc_info[Tomcat7.exe,wkset]")+last("proc_info[Tomcat7.exe,vmsize]")

          What I would like to do is.
          To check if the result is 0 or greater than 0.
          If it's 0 then the process is not alive, etc.
          Do you have any idea?

          Thanks in advance,
          Fotis

          Comment

          • coreychristian
            Senior Member
            Zabbix Certified Specialist
            • Jun 2012
            • 159

            #6
            Originally posted by Fotis
            Hello there, I would like your help on a similar issue.
            I want to check if a process is alive. So, I created the following calculated item.

            last("proc.num[Tomcat7.exe]")+last("proc_info[Tomcat7.exe,wkset]")+last("proc_info[Tomcat7.exe,vmsize]")

            What I would like to do is.
            To check if the result is 0 or greater than 0.
            If it's 0 then the process is not alive, etc.
            Do you have any idea?

            Thanks in advance,
            Fotis

            Just to note, since you have the 3 different items, you could just do this in one trigger without the calculated item.

            Is the calculated item your running not working though?

            The trigger expression for what I listed above could look something like the following.

            Code:
            {Template OS Linux:item.key1[].last()}=0&{Template OS Linux:item.key2[].last()}=0

            Comment

            • Fotis
              Junior Member
              • Sep 2014
              • 24

              #7
              You are right, this is much better.
              Thank you for the advice!

              Comment

              • zabbixei
                Junior Member
                • Dec 2014
                • 24

                #8
                sum of calculated items

                hey gusy,

                i want to sum to calculated items on map for example:

                {Cisco L3S2:ifInOctets.10101.last(0)}+{Cisco L3S2:ifOutOctets.10101.last(0)}
                {host:ifInOctets.port#.last(0).................... .................

                this is how my expression is but i dont know what i am mising here.

                with this expression i get the value of each port in and out but i dont get the sumation so could you guys please tell me how i am suppose to do that?

                thanks in advance.

                John

                Comment

                • coreychristian
                  Senior Member
                  Zabbix Certified Specialist
                  • Jun 2012
                  • 159

                  #9
                  Originally posted by zabbixei
                  hey gusy,

                  i want to sum to calculated items on map for example:

                  {Cisco L3S2:ifInOctets.10101.last(0)}+{Cisco L3S2:ifOutOctets.10101.last(0)}
                  {host:ifInOctets.port#.last(0).................... .................

                  this is how my expression is but i dont know what i am mising here.

                  with this expression i get the value of each port in and out but i dont get the sumation so could you guys please tell me how i am suppose to do that?

                  thanks in advance.

                  John
                  You might want to try something like the following.

                  last("Cisco L3S2:ifInOctets.10101")+last("{Cisco L3S2:ifOutOctets.10101.last(0)}")...

                  The documentation can be found at the link below.

                  Comment

                  • zabbixei
                    Junior Member
                    • Dec 2014
                    • 24

                    #10
                    Thanks for the reply!

                    it worked now.

                    my problem was that i was using that formula as micro in link indicator name field but i should make an item with calculated data type and use this formula: last("ifOutOctets.10101")+last("ifInOctets.10101")

                    so i get the summation of a port both in and outbound.

                    John

                    Comment

                    • mrbytecode
                      Junior Member
                      • Feb 2017
                      • 1

                      #11
                      Help me

                      Hello , You could place a screen I'm in the same problem and can not solve

                      Originally posted by zabbixei
                      Thanks for the reply!

                      it worked now.

                      my problem was that i was using that formula as micro in link indicator name field but i should make an item with calculated data type and use this formula: last("ifOutOctets.10101")+last("ifInOctets.10101")

                      so i get the summation of a port both in and outbound.

                      John

                      Comment

                      Working...