Send alert after 10 Bad and then 1 Good.
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.
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.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
This will not work, because "current" %Recurrences%==1(('%LastSimpleStatus%'=='DOWN') and (%Recurrences%==10)) and ('%SimpleStatus%' == 'UP')
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/mfra ... pendsOnBad
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)
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You are welcome.Thanks...
Issue resolved.
Code: Select all
Can you forward me the link where i can get all advanced expressions and their meaning?
http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction
Macro variables:
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use Advanced action with expression like the following:
%FailureIteration% mod 30 == 2
Please check for details at:
http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction
%FailureIteration% mod 30 == 2
Please check for details at:
http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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
('%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
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:
For every 30 min notifications.
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: Select all
%FailureIteration% mod 60 == 2
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
KS-Soft Europe - thank you!
Test interval is 10 sec, notification interval is 33 min and 33 sec:
Test interval is 10 sec, notification interval is 33 min and 33 sec:
Code: Select all
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
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
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:
It send me only Ok status and with different interval.
Thank you!
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: Select all
(%FailureIteration% mod (300 div %Interval_Sec%)) == 3
Thank you!
Use standard action:Test interval: 5 min
Start when: 3 Bad
Repeat: every 5 min
- start after 3rd consecutive failure
- repeat untill test status changes
Of course this action can be triggered on Bad, Ok, Unknown status. You do not check test status in this expression.(%FailureIteration% mod (300 div %Interval_Sec%)) == 3
It send me only Ok status and with different interval.
Regards
Alex