KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Send alert after 10 Bad and then 1 Good.

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
Sainyam



Joined: 12 Aug 2011
Posts: 37

PostPosted: Thu Jul 11, 2013 7:22 pm    Post subject: Send alert after 10 Bad and then 1 Good. Reply with quote

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
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Jul 11, 2013 11:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Sainyam



Joined: 12 Aug 2011
Posts: 37

PostPosted: Fri Jul 12, 2013 2:44 am    Post subject: Reply with quote

Thanks...

Issue resolved.
Can you forward me the link where i can get all advanced expressions and their meaning?
Back to top
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Jul 12, 2013 2:56 am    Post subject: Reply with quote

Quote:
Thanks...
Issue resolved.

You are welcome.

Code:
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/mframe.htm#actions.htm#advancedaction
Macro variables:
http://www.ks-soft.net/hostmon.eng/mframe.htm#actions.htm#macro
Back to top
View user's profile Send private message Send e-mail Visit poster's website
qwerty



Joined: 12 Sep 2013
Posts: 15

PostPosted: Thu Sep 12, 2013 5:54 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Sep 12, 2013 6:48 am    Post subject: Reply with quote

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/mframe.htm#actions.htm#advancedaction
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Sep 12, 2013 7:00 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
qwerty



Joined: 12 Sep 2013
Posts: 15

PostPosted: Thu Sep 12, 2013 7:33 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Thu Sep 12, 2013 8:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
qwerty



Joined: 12 Sep 2013
Posts: 15

PostPosted: Fri Sep 13, 2013 8:05 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft Europe



Joined: 16 May 2006
Posts: 2832

PostPosted: Fri Sep 13, 2013 8:19 am    Post subject: Reply with quote

You are welcome.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
qwerty



Joined: 12 Sep 2013
Posts: 15

PostPosted: Mon Sep 23, 2013 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Mon Sep 23, 2013 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index