Defining the tcl script and perl script – H3C Technologies H3C Intelligent Management Center User Manual

Page 495

Advertising
background image

481

$cleanConfig = $config;

return

$cleanConfig;

}

sub cleanupTFTPConfiguration

{

my($config) = @_;

$start = index($config, "!");

if ($start == -1)

{

$start = 0;

}

return substr($config, $start);

}

Defining the TCL script and Perl script

The TCL script consists of Expect commands. You do not need to compile the Telnet connection device
code because the connection is performed by the Configuration Center background. You only need to

compile returned value judgment and login interaction scripts, for example, enter_exec.tcl.
Some variables in the TCL script do not need to be defined. They are provided from the Configuration

Center background.

Common variables

ERROR_MESSAGE [OUT] (If the script has an error, you must assign a value to the variable.

Configuration Center then judges the execution result based on the variable.)

Username [IN] (Telnet user name)

Password [IN]

enable_password [IN]

Configuration backup variables

TFTPFile [IN] (local file name)

TFTPServer [IN]

Configuration deployment variables

TFTPFile [IN](local file name)

TFTPServer [IN]

Testvalue [OUT] (This variable is used for running configuration deployment. Assign a value, true or
false, to it, indicating whether the deployment is completed.)

Deleting software variables

TFTPFile [IN] (device software name)

TFTPServer [IN] (TFTP server)

transfer_protocol [IN] (protocol)

Advertising