beautypg.com

Cli usage – HP MPX200 Multifunction Router User Manual

Page 9

background image

Table 1 Remote CLI sample scripts (continued)

Description

Folder name

This folder contains scripts for automated migration of a large number of LUNs
based on input from a migration planning spreadsheet. A csv file can display

script_csv

(for example, in a spreadsheet) the output (results) of the execution of the Remote
CLI script. The script_csv example does just the opposite, that is, the
spreadsheet is used to generate the RCLI script.

At the customer site, initial planning for a data migration includes collecting
information about which LUNs are going to be migrated and their destination
locations. This information is typically collected in a spreadsheet that is approved
before the operation can start. The spreadsheet data is saved in csv format,
which is then used as input for the RCLI script csv command. The script
csv

output is a script that you can run in RCLI to automate the repetitive tasks

required in a data migration involving a large number of LUNs.

A basic example that shows the use of Remote CLI from a Windows batch file
and from a Linux shell script.

simple

This folder contains scripts used for automated testing of Remote CLI during
production builds. These scripts provide a good example of using Remote CLI

test

in a moderately complex Python application that runs identically on Linux and
Windows.

A Python script that produces a list of all routers in the local network, and the
serial number and IP address of each. With minor modifications, this script can

track_assets

collect other information from all routers in the local network. This script has no
input parameters.

Generating a script using a csv file from a spreadsheet

To re-create the example scripts described in

Table 1 (page 8)

:

1.

In the Remote CLI examples folder, open the Microsoft Excel
migration_planning_spreadsheet.xlsx

spreadsheet, and then save it as a csv file

named migration_planning_spreadsheet.csv.

2.

Open the csv file using a text file editor such as Notepad, delete the first line (column labels),
and then save the csv content to the following two text files:

sheet1_1_to_159.txt

sheet1_160_to_319.txt

3.

Create a sheet1_script.bat file for the Remote CLI script csv commands. For example:

rcli script csv
/csv_file=c:\t\make_script5\sheet1_1_to_159.txt
-file=bl1_hba0_mask_src_1_to_159.txt /cmd="add lunmask"
/ip=10.0.0.13 -fc_initiator=csv_c -lun_wwuln=csv_f

4.

Generate the script files by running the sheet1_script.bat file.

5.

Use Remote CLI to run the script files. For example:

rcli execute script /file=bl1_hba0_mask_src_1_to_159.txt
rcli execute script /file=bl1_add_migration_1_to_159.txt

CLI usage

The Remote CLI enables you to perform a variety of router management tasks through an Ethernet
connection.

CLI usage

9