Test propertis in a shell 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
cdarazs
Posts: 3
Joined: Wed May 13, 2009 6:16 am

Test propertis in a shell script

Post by cdarazs »

Hi,

I would like to write a shell script in vbscript.

In this script I need to use the test name and the test folderpath.

How can I get this parameters in the script?

Thnaks

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

Post by KS-Soft »

Use macro variables: %TestName% and %FullPath%

For details please check the manual, help system or use on-line help
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
http://www.ks-soft.net/hostmon.eng/mfra ... .htm#macro

Quote from the manual
=======================
Params
If script requires some parameters, "Hint" field will show you the list of parameters. E.g. "SYSTEM: Average Load for the past 5 min" script requires single parameter: <alert threshold>. If you specify "50" as the script parameter and script detects that system load is over 50%, it will set "Bad" status for the test. Otherwise status of the test will be "Ok".
Translate macros
With this option enabled you can use global macro variables as script parameters.

=======================

Regards
Alex
cdarazs
Posts: 3
Joined: Wed May 13, 2009 6:16 am

Post by cdarazs »

ok I see.

But


I have more then hundred test which use the special VBscript.

I would like to modify this script and want to use the test path parameter in the script.

My question is that how can I get the %FullPath% variable value and give to the vbs variable.

I tried this but this didn't working:

Dim TestFolder
Testfolder=%FullPath%
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Please read my previous answer. I was talking about Params property of the test. It allows you to specify different parameters for the same script.

If you are using VB Script you may use the following command as "Start cmd" parameter:
cmd /c cscript /B /E:VBScript %Script% %Params%

Then you may use parameters in the script
E.g.
dim i, objArgs
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.StdOut.Write objArgs(I)+" "
Next


Regards
Alex
cdarazs
Posts: 3
Joined: Wed May 13, 2009 6:16 am

Post by cdarazs »

ok.

If I understand well I only the parameters section can give data to the script.

Thanks a lot.

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

Post by KS-Soft »

Correct

Regards
Alex
Post Reply