beautypg.com

10 creating and executing cli scripts – HP 6Gb SAS Switch for HP BladeSystem c-Class User Manual

Page 77

background image

10 Creating and executing CLI scripts

If desired, create and execute scripts to automatically perform a task or series of tasks. CLI scripting
varies depending on operating systems, but the information provided in this section describes using
the Plink SSH utility in a Windows environment.

Creating and executing a script in a Windows environment includes the following steps:
1.

Create a .txt file with each command to execute, using exact command syntax.

2.

Create a .bat file with the information required to execute the .txt file.

3.

Open the SSH utility, such as Plink.

4.

At the user-designated time, execute the .bat file from the DOS console.

Example: This example illustrates flashing VSM firmware:

Scenario:

The firmware file has already been obtained and saved to an FTP server located at
192.168.1.1

The working folder on the Windows host is c:\flashvsm

An SSH connection utility, such as Plink and PuTTY, has already been obtained and installed
on the Windows host that can access the same LAN as the HP BladeSystem c-Class enclosure.

Procedure:
1.

Create the .txt file (in this example: vsmupgrade.txt):

switch loc=local flash file=ftp://192.168.1.1/vsm.img forced
switch loc=local reset hard forced

2.

Create the .bat file (in this example: autoflashing.bat):

c:\flashvsm\plink -ssh-l Administrator -pw hpinvent 192.168.1.1 -m vsmupgrade.txt

where plink is the scripting utility, Administrator is the VSM user name; hpinvent is
the user password; 192.168.1.1 is the VSM CLI IP address; and vsmupgrade.txt is the
script .txt file of commands.

3.

Execute the .bat file to run its embedded commands:

C:\flashvsm\autoflashing.bat

77