Use > Inventory Tools > Analysis Workbench Overview > Analysis Workbench Scripting

Analysis Workbench Scripting

The Analysis Workbench provides command script options that facilitate the automation of various settings which are manually set within the application (for example, loading, processing and outputting of information from Analysis Workbench).

The scripts are standard ASCII text files, similar in layout to Windows ini files, except that they do not use equals ‘=’ in the key lines in each section within the script. The scripts make use of the various configuration lists (load options, stored queries and so on) which can be stored as part of Analysis Workbench.

By using scripts which can call these stored configuration lists, different options and sequences can be predefined and run as required for regular exporting activities. Sample files have been provided with the Analysis Workbench. The scripts have an AWCS extension to the file name.

There are four script sections (if they exist) and are processed in the following order:

  • Startup section
  • Variables section
  • Process section
  • End section

Any number of other sections can be added to the script. Other sections are not processed unless they are called for specifically by the script.

These sections do not have to be in this order in the script file and do not have to exist.

A sample script is supplied with Universal Discovery in the following location:

c:\UCMDB\DataFlowProbe\tools\InventoryTools\AnalysisWorkbench\Scripts

Executing the Script

  • Scripts are executed by one of three methods:
    • Including the script name on the command line in Analysis Workbench (for example Analysis Workbench.exe script.awcs.
    • Opening Analysis Workbench and then dragging the script file name to the Analysis Workbench workspace.
    • Using the Run script file… option File menu.
  • Having these three options allows:
    • The script to run on a scheduled basis if using a Windows utility such as AT.
    • Different scripts to be run when the Analysis Workbench is opened under user control.
  • Do not use any commands in the [Variables] section. This section is used for declaring variables only.
  • Do not call any of the standard sections with the RUN_PROCESS command. (Startup, Variables, Process, End).
  • Do not name any variables with the same name as a reserved word (either a command name or a string used internally by the scripting engine).
  • Do not call a section that is a list of files or directories.

Writing Scripts

  • Create scripts in a text editor or in a Word processor without formatting.
  • Do not use any equal ‘=’ characters in the command line.
  • Save the script file with the extension AWCS.

All commands must have spaces between the command and its parameters. If there are multiple parameters, then these are separated by just a comma (for example, SAVE_STATE filename, description).

Group Commands into Sections

  • Sections have a section header written between square brackets, for example, [sectionname].
  • Section names must not begin or end with space characters and must not be preceded by a space before the name.
  • There are four reserved section names, STARTUP, VARIABLES, PROCESS and END.
  • Sections can be stored in any order, but the four reserved sections, if they exist, are processed in the order STARTUP- VARIABLES - PROCESS – END.

Add Comments to Scripts

Comments can be added to the scripts to improve readability, either by using a section headed [Comments] to describe the overall function of the script or by using a semicolon (‘ ;’) at the start of the line to indicate a comment line, to describe specific activity.