Using ifhw, Ifhw command-line syntax, Ifhw command-line arguments – HP Scripting Toolkit for Linux 9.60 User Manual

Page 28: Ifhw return codes, Ifhw command-line examples, Expression operators and terms

Advertising
background image

Using IFHW

IFHW is used from a script file, in conjunction with other utilities, to control the deployment. The
IFHW utility enables you to make intelligent queries against the hardware discovery file. Queries
take the form of a logical expression, and the result of the expression is returned as the return code
of the tool, which the hosting script can use to conditionally perform actions.

IFHW command-line syntax

ifhw [path]hpdiscoveryfilename [path]allboards.xml <expression>

IFHW command-line arguments

Description

Command-line argument

This argument specifies the hardware discovery file used
to run the query.

[path]hpdiscoveryfilename

This argument specifies the allboards.xml PCI device
list file, which is used to convert PCI IDs found in hardware

[path]allboards.xml

discovery into device names, such as "Smart Array 5i
Controller."

This argument specifies the query expression. See

“Expression operators and terms” (page 28)

.

<expression>

IFHW return codes

Meaning

Value

The expression is true.

0

The expression is false.

1

The expression was not understood or an argument was invalid.

2

IFHW command-line examples

Description

Command-line argument

This command returns the following error levels:

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

ERRORLEVEL 0 (True) if the Smart Array 5i is present

ERRORLEVEL 1 (False) if the device is not present

ERRORLEVEL 2 (Error) if the expression could not be
understood

Expression operators and terms

Result

Operator or term

True if both operands are true

and

True if either operand is true

or

True if the first operand is greater than the second

gt

True if the first operand is less than the second

lt

True if the first operand is greater than or equal to the second

gte

28

Scripting Toolkit utilities

Advertising