|
View previous topic :: View next topic |
Author |
Message |
genasea
Joined: 25 Sep 2002 Posts: 27
|
Posted: Thu Jan 21, 2021 1:52 pm Post subject: Tune up Reply Value and Use Warning status if |
|
|
This is in effort to help others who want to get some clarification on these two aspect of HM. Thanks to Alex and the team for pointing me in the right direction. I needed a bit more help than the manual provided, which HM Tech Support was happy to oblige.
How Hostmon Processes Test Reply/Status values
1. HM performs the test;
2. HM processes "Reverse alert" option;
3. HM sets "suggested" macro variables (%SuggestedStatus%, %SuggestedSimpleStatus%, %SuggestedReply%, %SuggestedReply_Integer% %SuggestedRecurrences% and %FailureIteration%) and does NOT change regular variables (%Status%, %Reply%, %Recurrences%, etc);
4. HM evaluates/processes ‘Use Warning status if’, and ‘Use Normal status if’ expressions ***NOTE: this is prior to looking at the script/code in ‘Tune up Reply value’. As such ‘Tune up Reply value’ has no effect on “Warning” or “Normal” status processing;
5. Finally HM modifies the current test fields (Status, Reply, Alive%, Passed tests, Failed tests, etc) based upon the script/code the user places in the ‘Tune up Reply value’.
This Means
1. %SuggestedReply% is non-changeable – meaning no matter what script/code the user places in ‘Tune up Reply value’, this variable is set by HM and will never change.
2. %Reply% is changeable using the script/code in the ‘Tune up Reply value’. So, what the user configures in the ‘Tune up Reply value’ field, modifies the value of %Reply% and %Reply_Integer%.
3. However, ‘Use “Warning” status if’ and ‘Use “Normal” status if’ is processed prior to the processing done in ‘Tune up Reply value’. Since the script/code the user configures in ‘Tune up Reply value’ has not occurred yet, %Reply% should not be used in ‘Use “Warning” Status if’ or ‘Use “Normal” status if’ since %Reply% is actually set to the value of the previous test, not the current test – and if one does use %Reply% in ‘Use “Warning” Status if’ or ‘Use “Normal” status if’ they are actually using old test information, not the current test information.
If you are using 'Tune up Reply value' and want to also use 'Use "Warning" status if' DO NOT use %Reply% in 'Use "Warning" status if' - use %SuggestedReply% instead.
A few examples which are used successfully in 'Tune up' and 'Warning':
Basically, this works by simply copying the code from ‘Tune up Reply value’ and place it in ‘Use “Warning” status if’, then change the end of the line to evaluate what you are testing for.
EXAMPLE #1
Here is what is in ‘Tune up Reply value’
[substr('%SuggestedReply%',indexof('%SuggestedReply%','Switch')+7,(indexof('%SuggestedReply%',',')-indexof('%SuggestedReply%','Switch ')-7))]
Here is what is in ‘Use “Warning” status if’
([substr('%SuggestedReply%',indexof('%SuggestedReply%','Switch')+7,(indexof('%SuggestedReply%',',')-indexof('%SuggestedReply%','Switch ')-7))]<>"C9600")
EXAMPLE #2
Here is what is in ‘Tune up Reply value’
['%SuggestedReply%' getword 2]
Here is what is in ‘Use “Warning” status if’
(['%SuggestedReply%' getword 2]<>"%fvar_asset_tag_#%")
EXAMPLE #3
Here is what is in ‘Tune up Reply value’
if (('%SuggestedReply%' getword 6)=='R') Rack; if (('%SuggestedReply%' getword 6)=='WM') Wall Mount; if (('%SuggestedReply%' getword 6)=='C') Cabinet; else Unknown Enclosure Type
Here is what is in ‘Use “Warning” status if’
NOTE: we are only interested if this specific test returns ‘R’ for rack, so we can leave all the other code out
if (('%SuggestedReply%' getword 6)<>'R')
**Note: Alex stated you do NOT need the square brackets for the "Warning" expression, but it is easy to simply copy and paste without any code changes, so I left them in for the examples.
I hope this helps someone when dealing with this aspect of HM. |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Thu Jan 21, 2021 3:57 pm Post subject: |
|
|
Thank you
Regards
Alex |
|
Back to top |
|
|
|
|
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
|