HP ProLiant SL2500 HP Scripting Toolkit 9.60 for Windows User Guide - Page 23

Expression examples, Using HWQUERY, HWQUERY command-line syntax

Page 23 highlights

Operator or term HWQ: Result The hardware discovery file is searched for , and the corresponding value is the value of this term. is case-sensitive. A literal string, used for comparison A literal number, used for comparison Expression examples Expression input "PCI:Smart Array 5i" Result True if the Smart Array 5i Controller is found in the system HWQ:TotalRAM gte 512 HWQ:ROMDate neq "11/12/2004" True if the amount of RAM in the hardware discovery file is at least 512 MB True if the ROM date in the hardware discovery file is not 11/12/2004 HWQ:SystemName eq "ProLiant DL380 G2" True if the system name in the hardware discovery file exactly matches "ProLiant DL380 G2" HWQ:SystemName eq "ProLiant DL380 G2" and "PCI:Smart Array 5i" and HWQ:ROMDate eq "11/12/2004" True if the system is a ProLiant DL380 G2 with a Smart Array 5i Controller present and a ROM date of 11/12/2004 "PCI:Smart Array 5i" or "PCI:Smart Array True if the system contains a Smart Array 5i Controller or 6i" a Smart Array 6i Controller Using HWQUERY HWQUERY is used from a script, in conjunction with other utilities, to control the deployment. The HWQUERY utility enables you to use data from the hardware discovery file in your own scripts. HWQUERY cannot alter environment variables directly. To set the variable, the output of HWQUERY must be used by the hosting script. The most common way to use it is to write the output to an intermediate script that is subsequently called by the hosting script. HWQUERY command-line syntax hwquery [drive:][path]hpdiscoveryfilename [drive:][path]allboards.xml variable= ... HWQUERY command line arguments Command-line argument [drive:][path]hpdiscoveryfilename [drive:][path]allboards.xml variable= ... Description This argument specifies the hardware discovery file used to run the query. This argument specifies the allboards.xml PCI device list file, which is used to convert PCI IDs found in hardware discovery into device names, such as "Smart Array 5i Controller." In this argument, variable is the name of an environment variable and is a PCI device name or the name of an element from the hardware discovery file. Arguments must be in quotes if contains spaces. is case-sensitive. You can specify multiple variable= arguments. Using HWQUERY 23

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

Result
Operator or term
The hardware discovery file is searched for <
string
>, and the corresponding value is the value
of this term. <
string
> is case-sensitive.
HWQ:
<string
>
A literal string, used for comparison
<string>
A literal number, used for comparison
<number>
Expression examples
Result
Expression input
True if the Smart Array 5i Controller is found in the system
"PCI:Smart Array 5i"
True if the amount of RAM in the hardware discovery file
is at least 512 MB
HWQ:TotalRAM gte 512
True if the ROM date in the hardware discovery file is not
11/12/2004
HWQ:ROMDate neq
"11/12/2004"
True if the system name in the hardware discovery file
exactly matches "ProLiant DL380 G2"
HWQ:SystemName eq
"ProLiant DL380 G2"
True if the system is a ProLiant DL380 G2 with a Smart
Array 5i Controller present and a ROM date of
11/12/2004
HWQ:SystemName eq
"ProLiant DL380 G2" and "PCI:Smart Array
5i" and HWQ:ROMDate eq "11/12/2004"
True if the system contains a Smart Array 5i Controller or
a Smart Array 6i Controller
"PCI:Smart Array 5i" or "PCI:Smart Array
6i"
Using HWQUERY
HWQUERY is used from a script, in conjunction with other utilities, to control the deployment. The
HWQUERY utility enables you to use data from the hardware discovery file in your own scripts.
HWQUERY cannot alter environment variables directly. To set the variable, the output of HWQUERY
must be used by the hosting script. The most common way to use it is to write the output to an
intermediate script that is subsequently called by the hosting script.
HWQUERY command-line syntax
hwquery [
drive:
][
path
]hpdiscoveryfilename
[
drive:
][
path
]allboards.xml
variable
=<
string
> ...
HWQUERY command line arguments
Description
Command-line argument
This argument specifies the hardware discovery file used
to run the query.
[drive:][path]hpdiscoveryfilename
This argument specifies the
allboards.xml
PCI device
list file, which is used to convert PCI IDs found in hardware
[drive:][path]allboards.xml
discovery into device names, such as "Smart Array 5i
Controller."
In this argument,
variable
is the name of an environment
variable and <
string
> is a PCI device name or the name
variable=<string>
of an element from the hardware discovery file. Arguments
must be in quotes if <string> contains spaces. <
string
> is
case-sensitive.
You can specify multiple
variable
=<
string
> arguments.
...
Using HWQUERY
23