HP XP P9500 Storage User Manual
Page 81
Two examples of scripts are shown below. Refer to these examples as needed to create a script
file that suits your needs.
•
Script example for creating a configuration report (page 81)
•
Script example for downloading a configuration report (page 82)
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, except the logout command, this example performs three 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 accumulate 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%
SET /a CNT_ADD=%CNT_ADD% + 1
%RAIDINF_PATH%\raidinf add report -servername %SERVER% -report ^
%REPORT_NAME%
if ERRORLEVEL 1 (
IF %CNT_ADD% GTR %LOOP% GOTO :ABEND
CALL :SLEEP
GOTO ADD_RETRY
)
Managing tasks
81