View previous topic :: View next topic |
Author |
Message |
Sainyam
Joined: 12 Aug 2011 Posts: 37
|
Posted: Thu Jul 11, 2013 7:22 pm Post subject: Send alert after 10 Bad and then 1 Good. |
|
|
Hi Support,
I want to set up alerts for my spamcop device. there are two condition.
I need to setup bad alerts after 10 bad continue events, that i achieved by setting start after setting in action profile.
but now i want 1 good events when issue resolve as follow up.
So i set this condition
(('%LastSimpleStatus%'=='DOWN') and (%Recurrences%==10)) and ('%SimpleStatus%' == 'UP')
But its not working. i am not getting good alerts after issue resolved. |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Jul 11, 2013 11:44 pm Post subject: |
|
|
Quote: | (('%LastSimpleStatus%'=='DOWN') and (%Recurrences%==10)) and ('%SimpleStatus%' == 'UP') |
This will not work, because "current" %Recurrences%==1
Actually HostMonitor has special option for this, called "Action depends on bad one":
-------------------
Action depends on "bad" one
This optional parameter is available for "Good" actions only. You can set "Good" action dependable on a "Bad" action. Why do you need it? For example you defined "Bad" action to send an e-mail notification to the network administrator when test fails 3 times consecutively (start when 3 consecutive "Bad" results occur), also you defined «Good» action to send a notification when the test status changes to "Good". What will happen if test fails 1 or 2 times and after this it restores "Good" status? HostMonitor will not send a notification about failure (because test did not fail 3 times) but the program will send notification about restoring "Good" status. To avoid unnecessary "Good" action execution you can mark "Action depends on "bad" one" option and select "Bad" action. In this case HostMonitor will start "Good" action only if corresponding "Bad" action was executed.
--------------------
Action depends on "bad" one: http://www.ks-soft.net/hostmon.eng/mframe.htm#actions.htm#DependsOnBad
On the other hand, if you are using Advanced Bad actions, you'll need to use Advanced Good action ("Action depends on bad one" option will not work with Advanced Bad actions).
Expression for Advanced Good action should look like the following:
('%SimpleStatus%'=='UP') and (%Recurrences%==1) and ('%PreviousStatusDuration_Sec%'>'%Interval_Sec%'*10) |
|
Back to top |
|
|
Sainyam
Joined: 12 Aug 2011 Posts: 37
|
Posted: Fri Jul 12, 2013 2:44 am Post subject: |
|
|
Thanks...
Issue resolved.
Can you forward me the link where i can get all advanced expressions and their meaning? |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
|
Back to top |
|
|
qwerty
Joined: 12 Sep 2013 Posts: 15
|
Posted: Thu Sep 12, 2013 5:54 am Post subject: |
|
|
Hello!
My Probe:
Disk space: Free 1 GB
Test every: 1 min
I want to setup alert after 2 bad events, but I want that notification will repeated only every 30 min if in this interval issue will not be resolved, but not every min.
How I can achieve this ? |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Sep 12, 2013 7:00 am Post subject: |
|
|
If you are using "Good" action with this test, you'll need to use also advanced Good action with expression like the following:
('%SimpleStatus%'=='UP') and (%Recurrences%==1) and ('%PreviousStatusDuration_Sec%'>='%Interval_Sec%'*2)
This Good action will be started only if test fails two or more times.
E.g:
Good Bad Bad Good -> Good action will be triggered
Good Bad Good -> Good action will NOT be triggered |
|
Back to top |
|
|
qwerty
Joined: 12 Sep 2013 Posts: 15
|
Posted: Thu Sep 12, 2013 7:33 am Post subject: |
|
|
KS-Soft Europe
Thank you for your answer, it seems to be working!
But can I create test interval independent action ?
Because if I will change time to 30 sec, i should change this to:
Code: | %FailureIteration% mod 60 == 2 |
For every 30 min notifications. |
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Thu Sep 12, 2013 8:08 am Post subject: |
|
|
In such case, expression may look like the following:
(%FailureIteration% mod (1800 div %Interval_Sec%)) == 2
Please note, this expression will work for test items with test interval less then 10 min. |
|
Back to top |
|
|
qwerty
Joined: 12 Sep 2013 Posts: 15
|
Posted: Fri Sep 13, 2013 8:05 am Post subject: |
|
|
KS-Soft Europe - thank you!
Test interval is 10 sec, notification interval is 33 min and 33 sec:
Code: | 9/13/2013 7:00:27 AM
9/13/2013 7:33:55 AM
9/13/2013 8:07:22 AM
9/13/2013 8:40:50 AM
9/13/2013 9:14:18 AM
9/13/2013 9:47:46 AM |
|
|
Back to top |
|
|
KS-Soft Europe
Joined: 16 May 2006 Posts: 2832
|
Posted: Fri Sep 13, 2013 8:19 am Post subject: |
|
|
You are welcome. |
|
Back to top |
|
|
qwerty
Joined: 12 Sep 2013 Posts: 15
|
Posted: Mon Sep 23, 2013 9:54 am Post subject: |
|
|
Hello,
I need help with another notifications settings:
Mail Relay:
Test interval: 5 min
Start when: 3 Bad
Repeat: every 5 min
This code working strange:
Code: | (%FailureIteration% mod (300 div %Interval_Sec%)) == 3 |
It send me only Ok status and with different interval.
Thank you! |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Sep 23, 2013 10:00 am Post subject: |
|
|
Quote: | Test interval: 5 min
Start when: 3 Bad
Repeat: every 5 min |
Use standard action:
- start after 3rd consecutive failure
- repeat untill test status changes
Quote: | (%FailureIteration% mod (300 div %Interval_Sec%)) == 3
It send me only Ok status and with different interval. |
Of course this action can be triggered on Bad, Ok, Unknown status. You do not check test status in this expression.
Regards
Alex |
|
Back to top |
|
|
|