|
|
| Author |
Message |
Ciaran Bryan Helper
Joined: 02 Apr 2004 Posts: 17
|
Posted: Tue Aug 24, 2004 3:30 pm Post subject: Testing Conditions |
|
|
Hi,
I've been using the conditions feature to send responses( snmp notifications) if a value returned by a test exceeds a pre-configured max.
e.g.
if current value >=80
then
do response
I need to then check on the next run if the condition has abated in order to send an snmp clear notification
e.g.
if current value is now less that previous value
then
do response
Cant figure out a way to evaluate this using the Value Type fields and logical operators provided. (CurVal, DeltaVal, RateofChangeVal)
I need a PreviousVal field or last non "U" value from the rrd to be returned.
Any ideas ?
Thanks. |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Tue Aug 24, 2004 10:22 pm Post subject: |
|
|
I agree... We'll try to get this feature into the next release. Thanks for the idea!
bug#258 |
|
| Back to top |
|
 |
Ciaran Bryan Helper
Joined: 02 Apr 2004 Posts: 17
|
Posted: Wed Aug 25, 2004 11:02 am Post subject: |
|
|
ok.
There is a way to do it by using the rate of change value type.
e.g.
if cur val is smaller that previous val i.e. condition has ceased
then
rate val = delta val/delta time
will always be negative as time always increases
This would do the trick to determine the condition but there is a problem
The process_condition function gets passed the sql row element rate val as a string then converts to an integer
so if the roc val = -0.023 then strtoint converts to 0 so you cant use a condition such as if roc < 0 then do whatever, because it will never return true.
Thanks,
Ciaran. |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Wed Aug 25, 2004 12:50 pm Post subject: |
|
|
| Why can't you just use delta values, which should remain integral? |
|
| Back to top |
|
 |
Ciaran Bryan Helper
Joined: 02 Apr 2004 Posts: 17
|
Posted: Wed Aug 25, 2004 2:26 pm Post subject: |
|
|
Let's see.
Take the case where the monitor always returns zero.
I want to see it it ever goes over a threshold of 50.
Next run it goes to 55
then on the next run i want to see if the condition is abated
Next run its back to 45
then the following would work
Current value < 50
AND
Delta Value < 0
But this setup would always be TRUE even if the return value never breeched the 50 limit.
I really kneed to know the last actual value available thats not "U"
Even though I know the delta I can never determine the previous in order to use it in the logic.
Ciaran |
|
| Back to top |
|
 |
Ciaran Bryan Helper
Joined: 02 Apr 2004 Posts: 17
|
Posted: Wed Aug 25, 2004 2:30 pm Post subject: |
|
|
So. i suppose what I need is.
if lastval >= 50
AND
curval <50
then condition is true.
I've looked up bug 258 and you seem to have maybe added this already ?
Also, just wondering when v 0.17 is planned for release ?
thanks a mill, |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Wed Aug 25, 2004 3:27 pm Post subject: |
|
|
| Yeah, I believe I got that bug fixed. As for when 0.17 is to be released, my hope is within a month. |
|
| Back to top |
|
 |
Ciaran Bryan Helper
Joined: 02 Apr 2004 Posts: 17
|
Posted: Wed Aug 25, 2004 4:57 pm Post subject: |
|
|
Hi,
i made the changed to events.cpp and added
3 => "Last Value"
to VALUE_TYPES array in stat.php
Tested condition if last_val = xx and it works fine.
Thanks a lot,
Ciaran. |
|
| Back to top |
|
 |
balleman Site Admin
Joined: 20 Jan 2003 Posts: 282
|
Posted: Wed Aug 25, 2004 4:59 pm Post subject: |
|
|
| Excellent! I'm glad NetMRG was able to accomodate your needs. Thanks for the testing, and the insight. |
|
| Back to top |
|
 |
|