begin prefetch block

Starts a set of commands to download files. Normally, when you download a file using IBM BigFix actions, the checksum is evaluated to guarantee authenticity. However, if the target of your download is in flux, such as an anti-virus definition, that requirement may be too restricting. To handle a case like this, theIBM BigFix provides dynamic download commands, which are bracketed by begin prefetch block and end prefetch block. For more information, see Introducing the Prefetch Block and Introducing Dynamic Downloads.

This feature is tightly integrated with your IBM BigFix Relay structure, optimizing download speeds and bandwidth. When an action requests a file, the relay checks its cache, and immediately forwards the file if available. Otherwise, the request is passed up the line until it reaches the IBM BigFix Server.

Dynamic downloading uses a white-list to ensure that only trusted sites are accessed. The while-list is contained in the following file:
On Windows systems:
<BES Server Install Path>\Mirror Server\Config\DownloadWhitelist.txt
On Linux systems:
<BES Server Install Path>/Mirror Server/config/DownloadWhitelist.txt
This file contains a list of URLs formatted as regular expressions, such as http://.*\.mysite\.com/.*. The URL you provide in a prefetch statement must match an entry in the white-list before it can be downloaded. If the URL isn't found in the list, the command fails with NotAvailable error.

These existing commands are allowed within the prefetch block:

// comment lines and blank lines
if/elseif/else/endif
parameter
action parameter query (treated as a comment by the client)

The following new commands are allowed within the prefetch block, but are not allowed outside of it:

add prefetch item
add nohash prefetch item
collect prefetch items
execute prefetch plug-in

Syntax

begin prefetch block

Only one prefetch command block can be used in an action script and it must be closed with an end prefetch block command.

Only comments or blank lines are allowed to precede this command. When processing actions with prefetch blocks, download, download as and prefetch are not allowed anywhere in the action script. The download now as command is allowed, but not inside or before the prefetch block.

Example

// action script to automatically update a URL manifest from a custom site
begin prefetch block 
    parameter "ini"="{file "server_bf.ini" of site (value of setting 
        "MyCustomSite") of client}"
    // prefetch the plug-in that provides the download list
    add prefetch item name=plugin.exe sha1=123 sha256=347 size=12
       url=http://www.mysite/downloads/myplugin.exe
    // collect above prefetch file (needed to create a manifest composed of URLs)
    collect prefetch items
    // execute the plug-in that produces a manifest from the ini data file
    execute prefetch plug-in "{download path "plugin.exe"}" /downloads 
        "{parameter "ini"}" 
        "{download path "urllist"}"
    // URL manifest formatted as lines containing: name=<n> sha256=<h2> size=<s> 
        url=<url> 
    add prefetch item {concatenation " ; " of lines of download file "urllist"}
end prefetch block
// action is now active, update the files:
waithidden "{download path "plugin.exe"}" /update "{parameter "ini"}" "{location of 
    download folder}"

This example downloads a plug-in that processes another file to produce a manifest containing a list of more files to download. When the prefetch block ends, the files have been downloaded and moved to the download folder and the rest of the action can continue.

Notes:

Older consoles and clients will reject action scripts that use the new prefetch functionality and identify them as containing syntax errors. Older relays will not process dynamic download actions even if the server and clients can handle it. Only one prefetch block is allowed in an action script.

Certain commands must not appear anywhere in an action script that contains a prefetch block: download, download as and prefetch. Download now might appear in the script, but it must come after the prefetch block.

Several new inspectors have been added to allow action script to reference download files using relevance substitution. These include download path name>, download file name>, and download folder. See the Inspector Guide for more information.

Version 7.2 and above