Ad Widget

Collapse

Calculated Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navtek007
    Senior Member
    • May 2005
    • 100

    #1

    Calculated Item

    Is it possible to create an item based. Eg i would like to find the percent memory usage of my windows server eg:

    memory[free] / memory[total]

    Is this possible?
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Yes, it is possible and supported.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • navtek007
      Senior Member
      • May 2005
      • 100

      #3
      any reason why mine isn't working then? have i got the syntax correct?

      Comment

      • themons
        Senior Member
        • Feb 2005
        • 110

        #4
        is anybody will be able to do this ?
        Zabbix 1.8.3
        SLES 11 x64

        French Zabbix user

        Comment

        • Clansman
          Junior Member
          • May 2006
          • 28

          #5
          I've just tried it and it doesn't work here either.
          It seems to pick up only the first part of the expression - in this case system.swap.size[,total]-system.swap.size[,free] or system.swap.size[,total] - system.swap.size[,free].

          Puzzled...

          Cheers,
          Pedro Venda.

          Comment

          • themons
            Senior Member
            • Feb 2005
            • 110

            #6
            yes i also have the problem. and in try different form of expression with {} () and [] nothing different or errors append when i want to save the item.
            Zabbix 1.8.3
            SLES 11 x64

            French Zabbix user

            Comment

            • emx
              Junior Member
              • Aug 2006
              • 19

              #7
              Alexei, could you elaborate on your answer?

              After a few hours reading the documention and the forums, I couldn't find a way to have "calculated" items.

              I have two stats ("success" and "total") and I want to calculate their ration.

              I have tried every possible syntax with "(" and "{" such as
              ({vm.stats[success]}/{vm.stats[total]})
              Also tried the "trigger" syntax to no avail.

              Of course vm.stats[aa] and vm.stats[bb] work well (they are UserParameter I defined in my zabbix_agentd.conf).

              A couple of people have asked about this on the forum. Last year, Alexei answered "Yes, it is possible and supported." however he did not provide any example of the syntax nor did he answer the few follow-up posts that complained it doesn't seem to work...

              Anyone knows how to "calculate" an item based on other items?

              Thanks for any hints...

              Comment

              • Alexei
                Founder, CEO
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Sep 2004
                • 5654

                #8
                There are no calculated items in ZABBIX. The functionality hasn't been implemented and I do know if it ever be.
                Alexei Vladishev
                Creator of Zabbix, Product manager
                New York | Tokyo | Riga
                My Twitter

                Comment

                • emx
                  Junior Member
                  • Aug 2006
                  • 19

                  #9
                  Thanks for this answer. At least I can stop trying now

                  This could be an interesting feature. In my context I get VoIP measurements through an external UserParameter item, e.g. Total SIP calls and Total Successful SIP calls. The ratio provides an important measure of quality. I can imagine a few other use of calculated fields.

                  Since you have written a parser for triggers, it shouldn't be hard to use it for items? That's my wild, uneducated and probably stupid guess.

                  Thanks anyway for the great work on Zabbix, I love it more every day.

                  Comment

                  • Alexei
                    Founder, CEO
                    Zabbix Certified Trainer
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Sep 2004
                    • 5654

                    #10
                    Originally posted by emx
                    Since you have written a parser for triggers, it shouldn't be hard to use it for items? That's my wild, uneducated and probably stupid guess.
                    I do not see any technical problems to have this feature implemented and it possibly will be done if this fits nicely into design of 1.4.
                    Alexei Vladishev
                    Creator of Zabbix, Product manager
                    New York | Tokyo | Riga
                    My Twitter

                    Comment

                    • emx
                      Junior Member
                      • Aug 2006
                      • 19

                      #11
                      Great news!

                      Thanks Alexei for considering this feature. In fact, I was about to contact you to volunteer producing a patch.

                      Comment

                      • testos
                        Member
                        • Apr 2007
                        • 85

                        #12
                        Greetings,

                        For obtaining percentage of available total memory i'm trying this item: vm.memory.size[free]) / vm.memory.size[total] * 100

                        zabbix doesn't complain but it gives back somewhat strange result same 8.89 M%.

                        User defined calculated items are more comfortable than to do it in triggers. Are they allowed now in the 1.4?

                        Regards.

                        Comment

                        • Alexei
                          Founder, CEO
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Sep 2004
                          • 5654

                          #13
                          No, calculated items are not supported by 1.4.x.
                          Alexei Vladishev
                          Creator of Zabbix, Product manager
                          New York | Tokyo | Riga
                          My Twitter

                          Comment

                          • jshuler
                            Junior Member
                            • Jul 2007
                            • 8

                            #14
                            So, how would a person get percent memory used?

                            Comment

                            • testos
                              Member
                              • Apr 2007
                              • 85

                              #15
                              Synthetic calculated items

                              As a workaround you may use synthetic calculated items (this is a work for the zabbix_agentd's userparameter).

                              a) For get percent memory used:
                              UserParameter=Memoria.PorcentajeUsada,echo "$((100-(`/usr/bin/zabbix_get -s 127.0.0.1 -k vm.memory.size[free]`*100/`/usr/bin/zabbix_get -s 127.0.0.1 -k vm.memory.size[total]`)))"

                              b) For get percent memory free:
                              UserParameter=Memoria.PorcentajeLibre,echo "$((`/usr/bin/zabbix_get -s 127.0.0.1 -k vm.memory.size[free]`*100/`/usr/bin/zabbix_get -s 127.0.0.1 -k vm.memory.size[total]`))"
                              Last edited by testos; 12-11-2007, 14:58.

                              Comment

                              Working...