Send alert after 10 Bad and then 1 Good.

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
Sainyam
Posts: 37
Joined: Fri Aug 12, 2011 12:31 am

Send alert after 10 Bad and then 1 Good.

Post by Sainyam »

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.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

(('%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/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)
Sainyam
Posts: 37
Joined: Fri Aug 12, 2011 12:31 am

Post by Sainyam »

Thanks...

Issue resolved.
Can you forward me the link where i can get all advanced expressions and their meaning?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Thanks...
Issue resolved.
You are welcome.

Code: Select all

Can you forward me the link where i can get all advanced expressions and their meaning?
Advanced mode actions:
http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction
Macro variables:
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro
qwerty
Posts: 15
Joined: Thu Sep 12, 2013 5:48 am

Post by qwerty »

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 ?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

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
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

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
qwerty
Posts: 15
Joined: Thu Sep 12, 2013 5:48 am

Post by qwerty »

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: Select all

%FailureIteration% mod 60 == 2
For every 30 min notifications.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

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.
qwerty
Posts: 15
Joined: Thu Sep 12, 2013 5:48 am

Post by qwerty »

KS-Soft Europe - thank you!
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
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
qwerty
Posts: 15
Joined: Thu Sep 12, 2013 5:48 am

Post by qwerty »

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: Select all

(%FailureIteration% mod (300 div %Interval_Sec%)) == 3
It send me only Ok status and with different interval.

Thank you!
KS-Soft
Posts: 12821
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
(%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
Post Reply