Change action interval but leave test interval as is?

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
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Change action interval but leave test interval as is?

Post by xcentric »

Currently I have a few tests set for every minute and a "Bad" after 5 failed atempts.

My issue is that I receive only "one" email when a "Bad" ocurs.
I could set the action profile to "until status changes" but then I receive an email every minute based on the test interval.
I could set the action profile to change the interval to say an hour but then the test itself is performed every hour along with the action.

Is there a way to keep the test interval at 1 minute but have the action repeated every hour after a "Bad" ocurs without using dependency tests?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Is there a way to keep the test interval at 1 minute but have the action repeated every hour after a "Bad" ocurs without using dependency tests?
Sure, you may use "advanced mode" actions and expression like
('%SimpleStatus%'=='DOWN') and (%Recurrences% mod 60==5)

For details please check the manual or visit our web site at
http://www.ks-soft.net/hostmon.eng/mfra ... ncedaction

Regards
Alex
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

Wow, you guys really have put thought and "logic" in this solution.

I need to explore using expressions more.

Thank you.
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

Previously I used the "Action depends on "Bad" one." for good actions.

Now that I use the expression above, the good action triggers on every bad instead of depending on bad.

Do I need to use another expression for the good action as well?

I have reviewed this thread but I am unclear how to write the expression.
http://www.ks-soft.net/cgi-bin/phpBB/vi ... 6340a3c458

Something like
('%SimpleStatus%'=='DOWN') and (%udv_new_global_variable%>5)

Global Variable = %PreviousStatusDuration_sec% div %Interval_sec%

You will probably laugh at that but I tried. :roll: I havent wrapped my head completely around the logic yet but I'm progressing.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

For "Good" action, you may use expression like this:

Code: Select all

('%SimpleStatus%'=='UP') and ((%PreviousStatusDuration_sec% div %Interval_sec%) >= 5) AND (%Recurrences% == 1)
This expression will start "Good" action one time, after test has "Bad" status 5 or more times.

Also "Good" action expression may look like:

Code: Select all

('%SimpleStatus%'=='UP') and (%PreviousStatusDuration_sec% >= 300) AND (%Recurrences% == 1)
xcentric
Posts: 176
Joined: Sat Oct 23, 2010 4:30 pm

Post by xcentric »

Great. Thank you. Exactly what I needed to acomplish.

Now it makes sense.
If the status is up and the last status was equal or more than 5 minutes ago and the current recurrence is 1 then trigger good action.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome !
Post Reply