User Defined Variables in a 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
nicksp
Posts: 7
Joined: Tue Jan 20, 2004 2:08 am

User Defined Variables in a script

Post by nicksp »

I have defined some udv's for the site -
eg udv_sitename=location

I want to reference these in a script through an "Execute Script" test,
'---- entry point ----
FUNCTION performtest()
Output="%udv_BaseDir%"
performtest = "Ok:" & output
END FUNCTION
The result is that output is defined literally as "%udv..." rather than the value I have assigned through the gui.
I tried also importing the script into the hml, same results.

ALSO
is there a problem with the vbscript execution - why does wscript.xxx not work - do you need to manually instantiate the obj first????

Thanks


Nick


[/quote]
User avatar
Marcus
Posts: 367
Joined: Mon Nov 18, 2002 6:00 pm

Post by Marcus »

I think you forgot the "Translate Macro's" option :wink:
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, "Active Script" (formerly "Execute Script") test method does not resolve user defined macro variables. It will be improved in the next version.

However there are simple workaround for both problems (macro variables and wscript object) - use new "Shell Script" test method instead of "Active Script". In this case you will not be able to use macro variables inside script but you will be able to use these variables as parameters. Using "Shell Script" test method HostMonitor starts script as external application, so it will work exactly in the same way you start script by Script Host.

Regards
Alex
Post Reply