Hi
We are using HM v9.10 on Windows 2008 SP2 (x64).
We would like to set CommentLine2 parameter of more than a hundred tests at the same time. These tests are selected based on a specific Alert Profile and are spread over several folders. As you know, selecting multiple tests and modifying their CommentLine2 parameter erase CommentLine1 content.
I examined HMS Script to do this. However, I see that I can select tests as group only based on status or test type (i.e, _AllGood, _AllPing). Also, I see that it is possible to set parameter if I know the test ID (SetTestParamByID). An easy way to extract test IDs (after creating a view based on desired alert profile) would also meet my need.
How can I do that?
Thanks.
BTW: Examining HMS Script showed me once again the strength of Host Monitor. Truly great product.
Setting CommentLine2 for Multiple Tests
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use Custom HTML report profile assigned to View and %TestID% macro variable (within profile) to generate/extract HTML/txt file with test IDs.
Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... CustomHTML
Please check the manual or visit our web site for more information at:
http://www.ks-soft.net/hostmon.eng/mfra ... CustomHTML
Thanks for reply.
Actually, what I would like to do is to control an alert profile. This alert profile sends email. The recipient field will be provided by CommentLine2. Also, I want to control the recipients through UDV. UDV is a great feature to manage mail recipients in my opinion.
I did what you said and extracted TestIDs. However, when I set a UDV variable as CommentLine02, it resolves the value and writes it, not udv variable (i.e., %udv_...%).
My script:
SetCurrentFolder Root
IncludeSubfolders yes
SetTestParamByID 3286 CommentLine02 %udv_cbs_group2%
This command does not set %udv_cbs_group2% to CommentLine2 but the real value, which is a mail address in my case. Therefore, this does not help my situation.
Any other solution?
Thanks.
Actually, what I would like to do is to control an alert profile. This alert profile sends email. The recipient field will be provided by CommentLine2. Also, I want to control the recipients through UDV. UDV is a great feature to manage mail recipients in my opinion.
I did what you said and extracted TestIDs. However, when I set a UDV variable as CommentLine02, it resolves the value and writes it, not udv variable (i.e., %udv_...%).
My script:
SetCurrentFolder Root
IncludeSubfolders yes
SetTestParamByID 3286 CommentLine02 %udv_cbs_group2%
This command does not set %udv_cbs_group2% to CommentLine2 but the real value, which is a mail address in my case. Therefore, this does not help my situation.
Any other solution?
Thanks.
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use "ResolveMacros no" command before "SetTestParamByID 3286 CommentLine02 %udv_cbs_group2%"
Quote from manual:
http://www.ks-soft.net/hostmon.eng/mfra ... #actScript
Quote from manual:
http://www.ks-soft.net/hostmon.eng/mfra ... #actScript
ResolveMacros yes|no Normally HostMonitor resolves macro variables specified in the script. However you may turn this option off at any time (and later turn it on again if you need). Command has effect for the following commands within the script (commands located below ResolveMacros line). For example this can be useful when you need to assign some macros for comment pattern.