PDA

View Full Version : Problem with avg() in Triggers


pilot
03-07-2006, 13:01
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
03-07-2006, 15:35
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

pilot
03-07-2006, 18:17
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.

Nate Bell
03-07-2006, 19:52
Oops I mixed up < and > in terms of triggers. :o 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

pilot
04-07-2006, 09:17
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.

pilot
04-07-2006, 11:08
Problem solved with using next trigger:

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

miscellaneous.

Nate Bell
05-07-2006, 15:26
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

dantheman
05-07-2006, 16:18
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