Ad Widget

Collapse

Problem with avg() in Triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pilot
    Junior Member
    • Jun 2006
    • 8

    #1

    Problem with avg() in Triggers

    Actions on triggers like
    {103:net.if.out[eth0].last(0)}/{103:net.if.out[eth0].avg(300)}<0.7
    send mail when quotient more than 0.7

    How can I avoid this problem?
  • Nate Bell
    Senior Member
    • Feb 2005
    • 141

    #2
    Of course it sends an email when the quotient is greater than 0.7, that's what you wrote the trigger's expression to do. What behavior were you hoping to have with your trigger?

    Nate

    Comment

    • pilot
      Junior Member
      • Jun 2006
      • 8

      #3
      I use this Action.
      It works when quotient <0.7 and it works when quotient >0.7

      Trigger description like "Traffic decrease"
      Trigger value = "ON"

      I think that problem is in avg() function.

      Comment

      • Nate Bell
        Senior Member
        • Feb 2005
        • 141

        #4
        Oops I mixed up < and > in terms of triggers. You're right, if that trigger is getting tripped when the quoient is greater than 0.7 then something wierd is going on. I would be suspicious of either avg() or the / opperator. Do you use either in another trigger and if so, is that trigger not working either?

        I know I have at least one trigger that's using avg() and seems to be working fine, but I've never used / so I'm not sure if that one works.

        Nate
        Last edited by Nate Bell; 03-07-2006, 19:54.

        Comment

        • pilot
          Junior Member
          • Jun 2006
          • 8

          #5
          Trigger:

          {131:mysql.stats[innodb.row.insert,10.0.0.113].avg(120)}=0 & {131:mysql.stats[innodb.row.update,10.0.0.113].avg(120)}=0 & {131:mysql.stats[innodb.row.delete,10.0.0.113].avg(120)}=0

          works fine

          How can I substitute "/" operator ??
          May be it is a problem.

          Comment

          • pilot
            Junior Member
            • Jun 2006
            • 8

            #6
            Problem solved with using next trigger:

            {103:net.if.out[eth0].last(0)}*0.7<{103:net.if.out[eth0].avg(300)}

            miscellaneous.

            Comment

            • Nate Bell
              Senior Member
              • Feb 2005
              • 141

              #7
              Huh, so it seems the "/" operator was at fault. That's annoying. Good thing you figured out another way to define the trigger.

              It would be nice if we could get a log of what a trigger evaluates to every time it checks itself, for debugging purposes. I'm assuming using "/" gives the trigger bogus values. Has anyone gotten a trigger to work using "/"?

              Nate

              Comment

              • dantheman
                Senior Member
                • May 2006
                • 209

                #8
                Yes I do have a working trigger using a / .. I'm calculating the percantage of disk space left.

                {Host.Win32:vfs.fs.size[d:,free].last(0)}/{Host.Win32:vfs.fs.size[d:,total].last(0)}<0.25

                Comment

                Working...