lsrsrc Command

Purpose

Displays attributes and values for a resource or a resource class.

Syntax

To display the attributes and values for a resource:

lsrsrc [-s "selection_string"] [ -a-N { node_file"-" } ] [ -A pdb ] [-p property] [ -l-i-t-d-D delimiter ] [-x] [-h] [-TV] [resource_class] [attr…]

lsrsrc -r [-s "selection_string"] [ -a-N { node_file"-" } ] [ -l-i-t-d-D delimiter ] [-x] [-h] [-TV] [resource_class]

To display the attributes and values for a resource class:

lsrsrc -c [ -A pdb ] [-p property] [ -l-i-t-d-D delimiter ] [-x] [-a] [-h] [-TV] resource_class [attr…]

lsrsrc -C domain_name… [ -A pdb ] [-p property] [ -l-i-t-d-D delimiter ] [-x] [-h] [-TV] resource_class [attr…]

To display a list of all of the resource classes:

lsrsrc

Description

The lsrsrc command displays the persistent and dynamic attributes and their values for a resource or a resource class.

Instead of specifying multiple node names in selection_string, you can use the -N node_file flag to indicate that the node names are in a file. Use -N "-" to read the node names from standard input.

When one or more attribute names are specified, these names and their values are displayed in the order specified, provided that each of the specified attribute names is valid. When no attribute names are specified:
  • the -A p | d | b flag controls whether persistent attributes or dynamic attributes or both — and their values — are displayed.
  • only attributes that are defined as public are displayed. Use the -p flag to override this default.

For best performance, specify either the -A p flag or only persistent attributes as parameters.

Specify the -r flag to display only the resource handles associated with the resources for the specified resource class.

To display a list of the attributes and values for a resource class, specify the -c flag.

By default, the resource attributes and values are displayed in long format. Use the -t, -d, or -D flag to display the resources in table format or delimiter-formatted output.

If Cluster Systems Management (CSM) is installed on your system, you can use CSM defined node groups as node name values to refer to more than one node. For information about working with CSM node groups and using the CSM nodegrp command, see the CSM: Administration Guide and the CSM: Command and Technical Reference.

The lsrsrc command does not list any attributes that have a datatype defined as ct_none (Quantum, for example). RMC does not return attribute values for attributes that are defined as Quantum. To list attribute definitions, use the lsrsrcdef command.

Flags

-a
Specifies that this command applies to all nodes in the cluster. The cluster scope is determined by the CT_MANAGEMENT_SCOPE environment variable. If it is not set, first the management domain scope is chosen if it exists, then the peer domain scope is chosen if it exists, and then local scope is chosen, until the scope is valid for the command. The command will run once for the first valid scope found. For example, if both a management and peer domain exist, lsrsrc -a with CT_MANAGEMENT_SCOPE not set will list the management domain. In this case, to list the peer domain, set CT_MANAGEMENT_SCOPE to 2.
-A p | d | b
Specifies an attribute type. By default only persistent attributes are displayed. This flag can be used only when no attribute names are specified on the command line.
p
Displays only persistent attributes.
d
Displays only dynamic attributes.
b
Displays both persistent and dynamic attributes.
For best performance, specify the -A p flag.
-c
Displays the attributes for the resource class. This flag overrides the -r flag.
-C domain_name…
Displays the class attributes of a globalized resource class on one or more RSCT peer domains that are defined on the management server. Globalized classes are used in peer domains and management domains for resource classes that contain information about the domain. To display class attributes of a globalized resource class on all peer domains defined on the management server, use the -c flag with the -a flag instead of -C. The command returns the name of the peer domain in the form of an attribute ActivePeerDomain. This is not an actual attribute, but is presented as such to indicate which peer domain is being displayed.
-d
Specifies delimiter-formatted output. The default delimiter is a colon (:). Use the -D flag if you want to change the default delimiter.
-D delimiter
Specifies delimiter-formatted output that uses the specified delimiter. Use this flag to specify something other than the default colon (:). An example is when the data to be displayed contains colons. Use this flag to specify a delimiter of one or more characters.
-i
Generates a template of resource_data_input_file that can then, after appropriate editing, be used as input to the mkrsrc command. The output is displayed in long (stanza) format. All required and optional attributes that can be used to define a resource are displayed. The attribute data type is displayed as the value in the attr=value pairs. It is suggested that when you use this flag, the output of the lsrsrc command be directed to a file. This flag overrides the -s and -A d flags.
-l
Specifies long formatted output. Each attribute is displayed on a separate line. This is the default display format. If the lsrsrc command is issued with the -l flag, but without a resource class name, the -l flag is ignored when the command returns the list of defined resource class names.
-N { node_file | "-" }
Specifies that node names are read from a file or from standard input. Use -N node_file to indicate that the node names are in a file.
  • There is one node name per line in node_file.
  • A number sign (#) in column 1 indicates that the line is a comment.
  • Any blank characters to the left of a node name are ignored.
  • Any characters to the right of a node name are ignored.
Use -N "-" to read the node names from standard input.

The CT_MANAGEMENT_SCOPE environment variable determines the scope of the cluster. If CT_MANAGEMENT_SCOPE is not set, management domain scope is chosen first (if a management domain exists), peer domain scope is chosen next (if a peer domain exists), and then local scope is chosen, until the scope is valid for the command. The command runs once for the first valid scope it finds. For example, if a management domain and a peer domain both exist and CT_MANAGEMENT_SCOPE is not set, this command applies to the management domain. If you want this command to apply to the peer domain, set CT_MANAGEMENT_SCOPE to 2.

-p property
Displays attributes with the specified property. By default, only public attributes are displayed. To display all of the attributes regardless of the property, use the -p 0 flag. Use this flag in conjunction with the -A flag when no attributes are specified on the command line.
Persistent attribute properties:
0x0001
read_only
0x0002
reqd_for_define (required)
0x0004
inval_for_define (not valid)
0x0008
option_for_define (optional)
0x0010
selectable
0x0020
public
Dynamic attribute properties:
0x0020
public
A decimal or hexadecimal value can be specified for the property. To display attributes and their values for all attributes that have one or more properties, "OR" the properties of interest together and then specify the "OR"ed value with the -p flag. For example, to display attributes and their values for all persistent attributes that are either reqd_for_define or option_for_define, enter:
lsrsrc -p 0x0a
-r
Displays the resource handles for the resources that match the specified selection string or all resources when no selection string is specified.
-s "selection_string"
Specifies a selection string. All selection strings must be enclosed within either double or single quotation marks. If the selection string contains double quotation marks, enclose the entire selection string in single quotation marks. For example:
-s 'Name == "testing"'
-s 'Name ?= "test"'

Only persistent attributes may be listed in a selection string. For information on how to specify selection strings, see the RSCT: Administration Guide .

-t
Specifies table format. Each attribute is displayed in a separate column, with one resource per line.
-x
Suppresses header printing.
-h
Writes the command's usage statement to standard output.
-T
Writes the command's trace messages to standard error. For your software-service organization's use only.
-V
Writes the command's verbose messages to standard output.

Parameters

resource_class
Specifies the name of the resource class with the resources that you want to display.
attr
Specifies one or more attribute names. Both persistent and dynamic attribute names can be specified to control which attributes are displayed and their order. Zero or more attributes can be specified. Attributes must be separated by spaces.

Security

The user needs read permission for the resource_class specified in lsrsrc to run lsrsrc. Permissions are specified in the access control list (ACL) file on the contacted system. See the RSCT: Administration Guide for information about the ACL file and how to modify it.

Exit Status

0
The command has run successfully.
1
An error occurred with RMC.
2
An error occurred with the command-line interface (CLI) script.
3
An incorrect flag was specified on the command line.
4
An incorrect parameter was specified on the command line.
5
An error occurred with RMC that was based on incorrect command-line input.

Environment Variables

CT_CONTACT
When the CT_CONTACT environment variable is set to a host name or IP address, the command contacts the Resource Monitoring and Control (RMC) daemon on the specified host. If the environment variable is not set, the command contacts the RMC daemon on the local system where the command is being run. The resource class or resources that are displayed or modified by the command are located on the system to which the connection is established.
CT_IP_AUTHENT
When the CT_IP_AUTHENT environment variable exists, the RMC daemon uses IP-based network authentication to contact the RMC daemon on the system that is specified by the IP address to which the CT_CONTACT environment variable is set. CT_IP_AUTHENT only has meaning if CT_CONTACT is set to an IP address; it does not rely on the domain name system (DNS) service.
CT_MANAGEMENT_SCOPE
Determines the management scope that is used for the session with the RMC daemon to monitor and control the resources and resource classes. The management scope determines the set of possible target nodes where the resources and resource classes can be monitored and controlled. The valid values are:
0
Specifies local scope.
1
Specifies local scope.
2
Specifies peer domain scope.
3
Specifies management domain scope.

If this environment variable is not set, local scope is used.

Implementation Specifics

This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.

Standard Output

When the -h flag is specified, this command's usage statement is written to standard output. All verbose messages are written to standard output.

Standard Error

All trace messages are written to standard error.

Examples

  1. To list the names of all of the resource classes, enter:
    lsrsrc
    The output will look like this:
    class_name 
    "IBM.Association"
    "IBM.Condition"
    'IBM.EventResponse"
    "IBM.Host"
    "IBM.Ethernet"
    "IBM.TokenRing"
    ... 
  2. To list the persistent attributes for resource IBM®.Host that have 4 processors, enter:
    lsrsrc -s "NumProcessors == 4" -A p -p 0 IBM.Host
    The output will look like this:
    Resource Persistent Attributes for: IBM.Host                                    
    resource 1:                                                                     
            Name           = "c175n05.ppd.pok.ibm.com"                                
            ResourceHandle = "0x4008 0x0001 0x00000000 0x0069684c 0x0d7f55d5 0x0c32fde3"                                                                               
            Variety        = 1                                                      
            NodeList       = {1}                                                    
            NumProcessors  = 4                                                      
            RealMemSize    = 1073696768          
  3. To list the public dynamic attributes for resource IBM.Host on node 1, enter:
    lsrsrc -s 'Name == "c175n05.ppd.pok.ibm.com"' -A d IBM.Host 
    The output will look like this:
    Resource Dynamic Attributes for: IBM.Host     
    resource 1:                                   
            ProcRunQueue        = 1.03347987093142
            ProcSwapQueue       = 1.00548852941929
            TotalPgSpSize       = 65536           
            TotalPgSpFree       = 65131           
            PctTotalPgSpUsed    = 0.61798095703125
            PctTotalPgSpFree    = 99.3820190429688
            PctTotalTimeIdle    = 0               
            PctTotalTimeWait    = 51.5244382399734
            PctTotalTimeUser    = 12.8246006482343
            PctTotalTimeKernel  = 35.6509611117922
            PctRealMemFree      = 66              
            PctRealMemPinned    = 4               
            RealMemFramesFree   = 173361          
            VMPgInRate          = 0               
            VMPgOutRate         = 0               
            VMPgFaultRate       = 0 
             ...              
  4. To list the Name, Variety, and ProcessorType attributes for the IBM.Processor resource on all the online nodes, enter:
    lsrsrc IBM.Processor Name Variety ProcessorType
    The output will look like this:
    Resource Persistent Attributes for: IBM.Processor
    resource 1:
            Name          = "proc3"
            Variety       = 1
            ProcessorType = "PowerPC_604"
    resource 2:
            Name          = "proc2"
            Variety       = 1
            ProcessorType = "PowerPC_604"
    resource 3:
            Name          = "proc1"
            Variety       = 1
            ProcessorType = "PowerPC_604"
    resource 4:
            Name          = "proc0"
            Variety       = 1
            ProcessorType = "PowerPC_604"
  5. To list both the persistent and dynamic attributes for the resource class IBM.Condition, enter:
    lsrsrc -c -A b -p 0 IBM.Condition
    The output will look like this:
    Resource Class Persistent and Dynamic Attributes for: IBM.Condition
    resource 1:                                                        
            ResourceType = 0                                           
            Variety      = 0                                                                                   
  6. To list the nodes in the cluster that have at least four processors, using the /tmp/common/node_file file:
    # common node file
    #
    node1.ibm.com      main node
    node2.ibm.com      main node
    node4.ibm.com      backup node
    node6.ibm.com      backup node
    #
    as input, enter:
    lsrsrc -s "NumProcessors >= 4" -N /tmp/common/node_file -t IBM.Host \
    Name NumProcessors
    The output will look like this:
    Resource Persistent Attributes for IBM.Host
    Name              NumProcessors
    "node1.ibm.com"   4
    "node2.ibm.com"   4

Location

/usr/sbin/rsct/bin/lsrsrc