[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 2

haemqvar Command

Purpose

Queries resource variables.

Syntax

haemqvar [ -H domain | -S domain ] [ -c | -d | -i ] [ -f file ] [ -h ] [ class var rsrcID [ " ] ]

Description

The haemqvar command queries the Event Management subsystem for information about resource variables. By default, the command writes to standard output the definitions for all resource variables in the current SP domain, that is, the current SP system partition as defined by the SP_NAME environment variable. If SP_NAME is not set the default system partition is used. The -S flag can be used to specify another SP domain (system partition). To query variables in an HACMP domain, use the -H flag. For an SP domain, the domain flag argument is a system partition name. For an HACMP domain, the domain flag argument is an HACMP cluster name. When the -H flag is specified, the command must be executed on one of the nodes in the HACMP/ES cluster.

The following information is reported for each resource variable definition:

Because the default behavior of this command can produce a large amount of output, standard output should be redirected to a file.

If the -d flag is specified only the resource variable name and a short description are written to standard output, one name and description per line.

If the -c flag is specified the current values of all resource variables instances are written to standard output, one per line. The line of output contains the location of the resource variable instance (node number), the resource variable name, the resource ID of the instance and the resource variable instance value. If the resource variable is a Structured Byte String (SBS) data type, then the value of each SBS field is reported.

The -i flag reports the same information as the -c flag except that the value of the variable instance is the last known value rather than the current value. The -i flag is useful for determining what resource variable instances exist.

For both the -c and the -i flags, if an error is encountered in obtaining information about a resource variable instance, the output line contains an error message, symbolic error codes, the location of where the error originated (if it can be determined), the resource variable name and the resource ID.

To return information about specific resource variables, specify the class, var and rsrcID operands. These operands can be repeated to specify additional resource variables. In addition, the var and rsrcID operands can be wildcarded to match a number of resource variables. Note that null string operands or an asterisk must be quoted in the shells.

If class is not a null string, then all variables in the specified class, as further limited by the var and rsrcID arguments, are targets of the query. If class is a null string, then variables of all classes, as further limited by the var and rsrcID arguments, are targets of the query. The var argument can be wildcarded in one of two ways:

  1. Specify the variable name as a null string
  2. Truncate the name after any component

When the resource variable name is wildcarded in the first manner, then all resource variables, as further limited by the class and rsrcID arguments, are targets of the query. When the resource variable name is wildcarded in the second manner, all resource variables whose high-order (leftmost) components match the var argument, as further limited by the class and rsrcID arguments, are targets of the query.

All resource variable instances, or definitions if neither the -c nor the -i flags are specified, of the variables specified by the class and var arguments that match the rsrcID argument are the targets of the query.

If neither the -c nor the -i flags are specified, the rsrcID argument is a semicolon-separated list of resource ID element names. If either the -c or the -i flags is specified, the rsrcID argument is a semicolon-separated list of name/value pairs. A name/value pair consists of a resource ID element name followed by an equal sign followed by a value of the resource ID element. An element value may consist of a single value, a range of values, a comma-separated list of single values or a comma-separated list of ranges. A range takes the form a-b and is valid only for resource ID elements of type integer (the type information can be obtained from the variable definition). There can be no blanks in the resource ID.

A resource ID element is wildcarded by specifying its value as the asterisk character. Only variables that are defined to contain the elements, and only the elements, specified in the rsrcID argument are targets of the query. If any element of the resource ID consists of the asterisk character, rather than a name/value pair (or just a name if querying for definitions), all variables that are defined to contain at least the remaining specified elements are targets of the query. The entire resource ID is wildcarded if it consists of only the asterisk character; all instances of all resource variables, as further limited by the class and var arguments, are targets of the query.

Note that the rsrcID argument must be quoted in the shells if it contains semicolons or asterisks.

The class, var and rsrcID operands can be placed in a file, one set of operands per line, instead of being specified as command arguments. Use the -f flag to specify the name of the file to the command. If the -f flag is used, any operands to the command are ignored. Within the file, null strings are specified as two adjacent double quotation marks. A completely wildcarded resource ID can either be a single asterisk (*) or an asterisk in double quotation marks ("*"). The arguments must be separated by blank spaces or tabs on each line.

Some examples of using wildcards in the rsrcID argument follow. For these examples, assume the class and var arguments are null strings. If either the class or var arguments or both are not null strings, targets for the query are restricted accordingly. In the first three examples, all variables whose resource IDs are defined to contain the elements NodeNum, VG and LV, and only those elements, are matched.

  1. In this example, only one instance is matched:
    NodeNum=5;VG=rootvg;LV=hd4
  2. In this example, one instance from each node is matched:
    NodeNum=*;VG=rootvg;LV=hd4
  3. In this example, all instances of the matching resource variables are matched:
    NodeNum=*;VG=*;LV=*
  4. In this example, all variables whose resource IDs are defined to contain only the element NodeNum are matched. The instances matched are associated with node 9:
    NodeNum=9
  5. In this example, the same set of variables are matched, but all instances of each variable are matched:
    NodeNum=*
  6. In this example, all variables whose resource IDs are defined to contain elements NodeNum and VG, as well as zero or more additional elements, are matched. The instances matched are associated with node 9:
    NodeNum=9;VG=*;*
  7. In this example, all variables whose resource IDs are defined to contain the element NodeNum, as well as zero or more additional elements, are matched. All instances of the variables are matched:
    NodeNum=*;*

Given the flexibility in specifying resource variables for query, it is possible that no resource variable instance or resource variable definition will match. If there is no match appropriate error information is reported, either in the form described above or as follows.

If the specification of the class, var or rsrcID arguments are in error, the output line contains an error message, symbolic error codes and the specified class name, resource variable name, and resource ID.

Flags

-H domain
Queries resource variables in the HACMP domain specified by domain.
-S domain
Queries resource variables in the SP domain specified by domain.
-c
Queries current resource variable values.
-d
Queries resource variable definitions but produces short form output.
-i
Queries instances of resource variables.
-f file
Queries resource variables specified in file.
-h
Displays a usage statement.

Parameters

class
Specifies the name of the resource variable class or a null string.
var
Specifies the name of the resource variable or a null string.
rsrcID
Specifies a resource ID or an asterisk.

Security

You must have root privilege and write access to the SDR to run this command.

You should be running on the control workstation. Before running this command, you must set the SP_NAME environment variable to the appropriate system partition name.

Exit Status

0
Indicates the successful completion of the command.
1
Indicates that an error occurred. It is accompanied by one or more error messages that indicate the cause of the error.

Restrictions

This command is valid in a PSSP environment only.

Standard Output

When the command executes successfully, it writes the following informational messages:

Reading Event Management data for partition syspar_name
 
CDB=new_EMCDB_file_name Version=EMCDB_version_string

Standard Error

This command writes error messages (as necessary) to standard error.

Examples

  1. To obtain the definitions of all resource variables in the current cluster and place the output in a file, enter:

    haemqvar -H HAcluster > vardefs.out
  2. To obtain a short form list of all resource variables whose resource IDs contain the element VG, in the HACMP cluster named HAcluster, enter:

    haemqvar -H HAcluster -d "" "" "VG;*"
  3. To obtain resource variables whose resource IDs contain only the elements VG and NodeNum, enter:

    haemqvar -H HAcluster -d "" "" "VG;NodeNum"

Location

/usr/sbin/rsct/bin/haemqvar
Location of the haemqvar command

Files

/usr/sbin/rsct/install/config/haemloadlist
Contains the default configuration data for the Event Management subsystem

Related Information

Commands: haemcfg, SDRCreateObjects, SDRDeleteObjects

Files: haemloadlist

For information about the System Data Repository (SDR) classes and attributes for the Event Management configuration database, see RSCT Event Management Programming Guide and Reference

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]