Some query commands include an option for conditional statements. Conditional statements take three forms:
Attribute=Value
(the attribute equals the value)
Attribute!=Value
(the attribute does not equal the value)
Attribute=~Value
(the value is the prefix of the attribute, for example a query for the state of a resource = ~faulted returns all resources whose state begins with faulted.)
Multiple conditional statements can be used and imply AND
logic.
You can only query attribute-value pairs displayed in the output of the command hagrp
-display
.
To display the list of service groups whose values match a conditional statement
hagrp -list [
conditional_statement
]
If no conditional statement is specified, all service groups in the cluster are listed.
To display a list of resources whose values match a conditional statement
hares -list [
conditional_statement
]
If no conditional statement is specified, all resources in the cluster are listed.
To display a list of agents whose values match a conditional statement