Parallels H-Sphere Documentation Developer Guide

 

Script Runner

 
 

Related Docs:   Script Runner Update

Last modified: 29 Aug 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

Script-runner is a utility that launches H-Sphere scripts on Unix/Linux servers.

H-Sphere control panel establishes an SSH connection with a Unix box and runs script-runner:

ssh -a -x root@xxx.xxx.xxx.xxx /hsphere/shared/scripts/script-runner.pl

Further, the control panel sends commands to the output stream of the SSH session and script-runner reads and performs the commands and then outputs.

The format of command passed to script-runner is:

COMMAND=command_name&PARAM1=param1&..&PARAMN=paramn&INPUT=input\n

It starts with the keyword COMMAND followed by actual command. Then, if necessary, it's followed by the parameters that are numbered from 1 and further. All parts of the command are separated with the ampersand (&). The '=' symbol is followed by the value. The command ends with the line feed character.

If the command requires standard input, you should set the INPUT parameter. Commands are passed in the 8-bit ASCII encoding. Command parameters and standard input are passed in the URL-encoding. Version 1.8 contains script-runner-b64 utility that has the same funcionality as script-runner, but data should be passed in the Base64 encoding and it returns the result in the same encoding.

Script-runner returns output in the following format:

OUTPUT=some_output&ERROR=text_of_error_or_empty_string&EXIT_CODE=0

If there is an error during script execution, parameter ERROR will contain the error text and output code EXIT_CODE will be nonzero. OUTPUT is a standard script output.

To check if script-runner is ready to accept commands, use 'PING' command. You should get the 'PONG' output.

Script-runner 1.8 logs all executed scripts and their output. They can be found in the /var/log/scriptrunner directory on the box where script-runner is running.


Related Docs:   Script Runner Update



© Copyright 2017. Parallels Holdings. All rights reserved.