Warning status after X failures

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
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Warning status after X failures

Post by Paul_NHS »

I have a test that returns "Unknown" if there is an error with the test. This is OK unless I get more than X recurrences.

I have used the following expression in "use warning status if", but the status won't stay at Warning.
('%SuggestedStatus%'=='Unknown') and ('%SuggestedRecurrences%'>'4')

I tried this expresssion, but it seems that the double brackets upset the processing as the status never changes.
('%SuggestedStatus%'=='Unknown') and (('%SuggestedRecurrences%'>'2') or ('%LastStatus%'=='Warning'))

cheers, Paul
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: Warning status after X failures

Post by KS-Soft Europe »

Paul_NHS wrote:I have used the following expression in "use warning status if", but the status won't stay at Warning.
('%SuggestedStatus%'=='Unknown') and ('%SuggestedRecurrences%'>'4')
This expression will work when "Treat Unknown status as Bad" and "Treat Warning status as Bad" options are enabled. http://www.ks-soft.net/hostmon.eng/mfra ... processing

Regards,
Max
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Post by Paul_NHS »

Max,

I only want the test to return Warning as I have a different action profile for Bad. It does change to Warning, but on the next test it returns to Unknown.

cheers, Paul
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Quote from the manual:
======================
"Treat Unknown status as Bad" and "Treat Warning status as Bad" options do HAVE an influence on the following features:
...
...
Actions: most important - these options define HostMonitor's behavior when test status changes.
If options are disabled, HostMonitor will reset recurrences counter for each status change (bad <-> unknown <-> warning). Also, if options are disabled, HostMonitor will not start standard actions for "Unknown" and/or "Warning" statuses (however you may use advanced actions). As a result this leads to reset of Acknowledged flag, so if you acknowledge Warning status and then status of the test changes to Bad, HostMonitor clears ACK flag and starts specified "bad" actions. Therefore you may need to acknowledge test status again.
If options are enabled, HostMonitor treats "bad", "unknown" and "warning" as the same status and will not reset "recurrences" counter, will not clear ACK flag either but will start standard actions for "Unknown" and/or "Warning" statuses.
======================
This means if you have disabled "Treat Unknown status as Bad" and "Treat Warning status as Bad" options, HostMonitor will reset "recurrences" counter (%SuggestedRecurrences% -> 1)

I think you should enable options and use "advanced mode" actions.
E.g. start action when ('%Status%'=='No answer') and (%Recurrences%==1)

Regards
Alex
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Post by Paul_NHS »

Thanks Alex, this confirms the behaviour I am seeing, but doesn't really solve the issue for me.

I have an advanced action set to fire off the warning notification and a standard action for bad notification, both of which work as expected. What I would like to achieve is to keep the warning status when the result is "unknown", until either a bad test result, or a good test result. This was what I was attempting with this expression:
('%SuggestedStatus%'=='Unknown') and (('%SuggestedRecurrences%'>'2') or ('%LastStatus%'=='Warning'))

cheers, Paul
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

('%SuggestedStatus%'=='Unknown') and (('%SuggestedRecurrences%'>'2') or ('%LastStatus%'=='Warning'))
Good idea :)
Probably I need a vacation :roll:

Regards
Alex
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Post by Paul_NHS »

Probably I need a vacation :roll:
You too?

Any thoughts on why that test doesn't seem to work?

cheers, Paul
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Does not work? Oh, I though you found solution
It does not work because
Quote:
1) HostMonitor performs the test;
2) processes "Reverse alert" option;
3) sets "suggested" macro variables (%SuggestedStatus%, %SuggestedSimpleStatus%, %SuggestedReply%, %SuggestedRecurrences% and %FailureIteration%) without touching regular counters (%Status%, %Reply%, %Recurrences%, etc);
4) then HostMonitor evaluates "Warning", "Normal" and "Tune up Reply" expressions and finally modifies current test status, reply field and statistics counters (Status, Reply, Alive%, Passed tests, Failed tests, etc).

You should use %Status% variable instead
('%SuggestedStatus%'=='Unknown') and ((%SuggestedRecurrences%>2) or ('%Status%'=='Warning'))

Regards
Alex
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Post by Paul_NHS »

Thanks, Alex. I'll give that a whirl.

cheers, Paul
Paul_NHS
Posts: 59
Joined: Wed Feb 25, 2009 6:17 am

Post by Paul_NHS »

Alex, Works a treat!

cheers, Paul
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Great :)
Post Reply