A question about HMS script

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
leo1631
Posts: 55
Joined: Thu Apr 27, 2006 8:51 pm

A question about HMS script

Post by leo1631 »

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.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Re: A question about HMS script

Post by KS-Soft Europe »

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)?
Quote from manual:
=============
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?
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?
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.

Regards,
Max
leo1631
Posts: 55
Joined: Thu Apr 27, 2006 8:51 pm

Re: A question about HMS script

Post by leo1631 »

KS-Soft Europe wrote: What value you are going to recieve? ErrorCode? StdOut?
I'll receive a part of test's URL which should be changed.
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.
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 .

Thanks.
leo1631
Posts: 55
Joined: Thu Apr 27, 2006 8:51 pm

Re: A question about HMS script

Post by leo1631 »

KS-Soft Europe wrote: What value you are going to recieve? ErrorCode? StdOut?
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: 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.
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 .

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

Post by KS-Soft »

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
Post Reply