A http test, which url address need to be changed when its status is bad at the first time, I decided to do that using HMS script.
My question is : in HMS script, how can I receive the return value from external program(using "execute program" command)? Creat a testlist file and then load it in HMS script maybe an idea, but it's not a good idea I think, is there any other solution?
Thanks.
A question about HMS script
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
Re: A question about HMS script
Quote from manual:leo1631 wrote:A http test, which url address need to be changed when its status is bad at the first time, I decided to do that using HMS script. My question is : in HMS script, how can I receive the return value from external program(using "execute program" command)?
=============
Executes external program, waits until external program is terminated, and continues to execute the script. If parameter <TimeToWait> is not equal to 0, HostMonitor will "kill" the external application when the application is not finished within the given timeout (time defined in milliseconds).
Be careful with this command, HostMonitor stops monitoring when executes external program by this command.
=============
What value you are going to recieve? ErrorCode? StdOut?
I think you may use HMS script in another way. E.g. You shoud create two HTTP tests with different URLs. Second test you should make disabled. Now you should create HMS script, that has to enable second test and disable first. You may use "Run HMS Script" action to run such script when first test status goes to bad. You also may create another HMS script, that should enable first test and disable second and use foregoing configuration to switch checked URL's.leo1631 wrote:Creat a testlist file and then load it in HMS script maybe an idea, but it's not a good idea I think, is there any other solution?
Regards,
Max
Re: A question about HMS script
I'll receive a part of test's URL which should be changed.KS-Soft Europe wrote: What value you are going to recieve? ErrorCode? StdOut?
But the question is: the test's URL is depended on the received value, can not be set at first. In fact, the external program's result value is a string about user's authorization which should be added to the URL .KS-Soft Europe wrote: I think you may use HMS script in another way. E.g. You shoud create two HTTP tests with different URLs. Second test you should make disabled. Now you should create HMS script, that has to enable second test and disable first. You may use "Run HMS Script" action to run such script when first test status goes to bad. You also may create another HMS script, that should enable first test and disable second and use foregoing configuration to switch checked URL's.
Thanks.
Re: A question about HMS script
I'll receive a part of test's URL which should be changed. In fact, the external program's result value is a string about user's authorization which should be added to the URL .KS-Soft Europe wrote: What value you are going to recieve? ErrorCode? StdOut?
But the question is: the test's URL is depended on the received value, can not be set at first. In fact, the external program's result value is a string about user's authorization which should be added to the URL .KS-Soft Europe wrote: I think you may use HMS script in another way. E.g. You shoud create two HTTP tests with different URLs. Second test you should make disabled. Now you should create HMS script, that has to enable second test and disable first. You may use "Run HMS Script" action to run such script when first test status goes to bad. You also may create another HMS script, that should enable first test and disable second and use foregoing configuration to switch checked URL's.
Thanks.
Change URL using external program? H'm.. the only solution I see - use "Import from text file" feature. Setup external script to create file like this one http://www.ks-soft.net/hostmon.eng/examples/import1.htm
And use HM Script action to execute that external program and then import test settings from the file (ExecuteProgram and ImportFromFile commands)
Regards
Alex
And use HM Script action to execute that external program and then import test settings from the file (ExecuteProgram and ImportFromFile commands)
Regards
Alex