Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Automatic Operation Service Template Developer's Guide


4.3.9 Procedure for setting scripts

This section describes how to set the script that executes on the operation-target host. To make sure that the plug-in is compatible with the operating system (Windows or UNIX) on the remote host, choose an appropriate script for each operating system. In a script, you can define scripts and commands that are present on the operation target device and which the operation target device can execute.

You can configure a script by attaching an existing script, or by entering the contents of the script directly.

When defining a script that consists of multiple files, or a script that uses a specific character set or linefeed code, follow the procedure described in Attaching an existing script file. When you use the procedure described in Entering a script directly, you can define only one script file and the character set and line-feed character are fixed for the intended operating system.

Use ASCII characters in the script file. You cannot use the following characters:

You cannot specify a file name that contains multi-byte characters.

The return values of scripts executed as plug-ins can be from 0 to 63.

Plug-ins and service templates must be designed in such a way that standard output and standard error output produce less than 100 KB of data. When the standard output or standard error output of a plug-in exceeds 100 KB, the command is immediately killed and the plug-in terminates with an error. In this scenario, the execution results of the command cannot be guaranteed.

The locale setting that applies when a script is executed depends on the operating system of the target device. For details about the locale assigned at the operation target device, see 4.1.7 Locale set for operation target devices during plug-in execution.

If the Create Plug-in dialog box or Edit Plug-in dialog box is not displayed:

  1. In the Plug-in view of the Editor window, display the Under Development tab.

  2. To create a new plug-in, click the Create button.

    To edit an existing plug-in, select a plug-in and then click the Edit button.

Attaching an existing script file

  1. In the Remote Command area of the Create Plug-in dialog box or the Edit Plug-in dialog box, click Edit.

  2. In the Edit Remote Command dialog box, specify the Script option for Execution Mode.

  3. In the Command line text box, enter the command that executes the script.

    Although only one script file can be registered, you can register a script that consists of several files and folders in a hierarchical structure by compressing the files into an zip archive. If the script is a single file, specify the file name in the Command line text box. If the script is a zip archive containing multiple files, specify a relative path whose current directory is the location where the archive will be extracted.

  4. In the Setting the Scripts area, select the Attachment option.

  5. In the File area, click Select and register the script.

Entering a script directly

  1. In the Remote Command area of the Create Plug-in dialog box or the Edit Plug-in dialog box, click Edit.

  2. In the Execution Mode area of the Edit Remote Command dialog box, select the Script option.

  3. In the Command line text box, enter the command that executes the script.

  4. In the Setting the Scripts area, select the Direct Input option.

  5. Enter values in the File Name field and the Script text box.

    In the File Name field, enter the name of the file in which to store the code entered in the Script text box. In the Script text box, enter the script code.

You can later replace the file you registered on the server by selecting another file.

Tip

For details about how to set return values when executing a command or script, see 4.3.11 Return values of content plug-ins.

Related topics