Preparing a script file – HP XP RAID Manager Software User Manual

Page 68

Advertising
background image

Preparing a script file

Before creating a configuration report by using the Report Configuration Tool, you must write a
series of commands in script files. When writing scripts, you need to write several commands in
a script file. When you run the Report Configuration Tool, the commands in the script files execute
sequentially and then a configuration report is created or deleted. For details on the commands
for the Report Configuration Tool, see

“Report Configuration Tool Command Reference (raidinf

commands)” (page 102)

.

Two examples of scripts are shown below. You can refer to these examples and create a script
file that suits your needs.

“Script example for creating a configuration report”

“Script example for downloading a configuration report”

Script example for creating a configuration report

This script logs the user in, deletes a configuration report, creates a configuration report, and logs
the user out, using the Report Configuration Tool.

For each command other than a logout, this example performs 3 retries at intervals of 2 minutes,
assuming that communication errors and other errors can occur. In addition, the delete report
command is executed with the -fill option before the add report command, so that the script
does not terminate when 20 configuration reports are accumulated in the web server (SVP).

REM
REM Create Report Script(CreateReport.bat)
REM
SET USER=<Username for Remote Web Console>
SET PASS=<Password for Remote Web Console>
SET SERVER=<Hostname or IP address of SVP>
SET REPORT_NAME=DailyConfigurationReport
SET LOOP=2
REM LOOP:0-2 3Times
SET TIMEOUT=121
REM TIMEOUT 2[minutes]=120[s]
SET RAIDINF_PATH="C:\Program Files\raidinf"
SET /a CNT_LOGIN=0

:LOGIN_RETRY
REM ############################# LOGIN %CNT_LOGIN%
SET /a CNT_LOGIN=%CNT_LOGIN% + 1
%RAIDINF_PATH%\raidinf -login %USER% %PASS% -servername %SERVER%
if ERRORLEVEL 1 (
if %CNT_LOGIN% GTR %LOOP% GOTO :ABEND
CALL :SLEEP
GOTO LOGIN_RETRY
)

SET /a CNT_DEL=0
:DEL_RETRY
REM ############################# DELETE %CNT_DEL%
SET /a CNT_DEL=%CNT_DEL% + 1
%RAIDINF_PATH%\raidinf delete report -servername %SERVER% ^
-report %REPORT_NAME% -fill
if ERRORLEVEL 1 (
IF %CNT_DEL% GTR %LOOP% GOTO :ABEND
CALL :SLEEP
GOTO :DEL_RETRY
)

SET /a CNT_ADD=0
:ADD_RETRY
REM ############################# ADD %CNT_ADD%

68

Viewing and managing the storage system

Advertising
This manual is related to the following products: