Ad Widget

Collapse

Triggers with calculations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RafS
    Junior Member
    • Jan 2005
    • 6

    #1

    Triggers with calculations

    Is it possible to create a trigger like

    '(({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)} * 100) / {Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}) <=5'

    I always get an error when trying to store this in the database.

    [ERROR:Invalid trigger expression]

    Regards
    Raf Schandevyl
  • RafS
    Junior Member
    • Jan 2005
    • 6

    #2
    Sorry Mistyped the expression

    (({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)} * 100) / {Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)}) <=5

    This function calculates the % off free disk space for my Machines

    Regards
    Raf

    Comment

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

      #3
      Try this instead:

      ({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<=0 .05
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

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

        #4
        Sorry, "<=" is not supported, use '<'.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • RafS
          Junior Member
          • Jan 2005
          • 6

          #5
          I've tried this

          ({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<0. 05

          With no success. Still the same error.

          Raf

          Comment

          • jpawlowski
            Member
            • May 2005
            • 45

            #6
            have the same problem, already reported in this forum so here should be a cross-link :-)



            unfortunately still no solution...

            Comment

            • cooper
              Senior Member
              • Sep 2004
              • 110

              #7
              Originally posted by RafS
              I've tried this

              ({Host.SNMP.Win32.VMWARE:hrStorageUsed.last(0)}/{Host.SNMP.Win32.VMWARE:hrStorageSize.last(0)})<0. 05

              With no success. Still the same error.

              Raf
              I had a similar problem a while ago check https://www.zabbix.com/forum/node/122

              hth,

              cooper

              Comment

              • jpawlowski
                Member
                • May 2005
                • 45

                #8
                no, our problem is different. we are not even able to create the trigger but get the error "Invalid trigger expression".

                Comment

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

                  #9
                  I succesfully added the following trigger on my test system (1.1alpha10):

                  ({a0.system[procload].last(0)}/{a0.system[procload].last(0)})<0.05

                  I do not quite understand why ZABBIX refuses your trigger.

                  Alexei Vladishev
                  Creator of Zabbix, Product manager
                  New York | Tokyo | Riga
                  My Twitter

                  Comment

                  • jpawlowski
                    Member
                    • May 2005
                    • 45

                    #10
                    i found zabbix's failure: a trigger like the above does work while the same expression only with an arithmetical minus instead of the division does not.

                    Works:
                    ({Host:check_url_lastmod[URL].now(0)}/{Host:check_url_lastmod[URL].last(0)})>21600

                    Works not:
                    ({Host:check_url_lastmod[URL].now(0)}-{Host:check_url_lastmod[URL].last(0)})>21600

                    Comment

                    • RafS
                      Junior Member
                      • Jan 2005
                      • 6

                      #11
                      I found my problem. You can't use spaces in the expressions.


                      Everthing works fine for me now.

                      Regards
                      Raf

                      Comment

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

                        #12
                        Well, I should have done the expressions less sensible. I will fix it in 1.1.
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        Working...