Warning status after X failures
Warning status after X failures
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
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
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Re: Warning status after X failures
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 ... processingPaul_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')
Regards,
Max
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
======================
"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
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
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
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
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