beautypg.com

3 advanced topics, Overview, Querying the hpdiscovery file based on system name – HP Scripting Toolkit for Windows User Manual

Page 12

background image

3 Advanced topics

Overview

The advanced topics addressed in this section cover some of the most common deployment tasks
that can be automated using the Scripting Toolkit.

IMPORTANT:

The script files and script segments in this section are provided only as examples.

You must modify the scripts for your environment. When creating or modifying your own scripts,
the pause command is a valuable tool to help you determine that each step of the script is
functioning as desired.

Customizing deployment scripts using HPDISCOVERY and IFHW

Use the HPDISCOVERY utility to determine which devices and capabilities are available in a
particular HP ProLiant server. HPDISCOVERY generates an XML-based output file that provides
information such as system ROM version, amount of RAM available, and the types of devices
present in the system. Then, use the HWQUERY and IFHW (IF Hardware utility) files to query the
output file, enabling you to add conditional tests to a script so it performs different operations
based on the outcome of the tests.

Querying the HPDISCOVERY file based on system name

In the following script, the IFHW utility searches the HPDISCOVERY data in the hpdiscovery.xml
file for the system name HP ProLiant BL20p. If the system name is found, the script calls the
bl20p.cmd

file.

ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant BL20p"

if errorlevel 1 goto NEXT1

call .\BL20p.cmd

goto end

:NEXT1

ifhw .\hpdiscovery.xml allboards.xml HWQ:SystemName eq "ProLiant DL380 G4"

if errorlevel 1 goto NEXT2

call .\ DL380G4.cmd

goto end

Querying the HPDISCOVERY file to determine the presence of a particular card

Using IFHW to detect a particular PCI card or device can be valuable in determining which settings
to apply. For example, an array controller used as a boot controller might require a RAID 1 setting,
while an optional array controller used for a database (such as a Smart Array 5312 Controller)
might require a RAID 5 ADG setting. The following example demonstrates how to use IFHW to
detect a particular card or device:

REM *** Configure the array controllers by reading the configuration

REM *** information in the script file and stamping it onto the array

REM *** controllers of the target server

echo Configuring the Array Controllers...

ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 5i Controller"

if errorlevel 1 GOTO NEXT1

.\ACU\bin\hpacuscripting.exe -i .\ArraySettings\SA5iArray.ini

:NEXT1

ifhw .\hpdiscovery.xml allboards.xml PCI:"Smart Array 6i Controller"

if errorlevel 1 GOTO NEXT2

12

Advanced topics