lsrsrcassoc Command

Purpose

Retrieves a list of resources that are associated with a class using an association provider.

Syntax

lsrsrcassoc [-s "source_selection_string"] [-c association_class] [-d association_endpoint_class] [-S "destination_selection_string"] [-o role] [-R result_role] [-h] [-TV] source_class_name [property_list…]

Description

You can use the lsrsrcassoc command to learn about the relationships among CIM resources.

This command is an interface into the association query mechanism of the Common Information Model (CIM) resource manager. Association providers that are registered with the CIM resource manager are called to retrieve association data. Before using lsrsrcassoc, it might be helpful to run the lsassocmap command to find out which association classes are known to the resource monitoring and control (RMC) subsystem.

You must specify a source class name with the lsrsrcassoc command. With no flags specified, lsrsrcassoc retrieves all resources associated with every resource of this class. Flags can be used to filter which associated resources are displayed.

The command output is similar to that of lsrsrc. Resources associated with a source resource are displayed with their class name and one attribute per line to facilitate searching and filtering the output.

Parameters

source_class_name
Specifies the source class in the association.
property_list
Specifies one or more property names. Only these properties (or attributes, in RMC terminology) of associated resources are displayed. If you do not specify this parameter, all property names are displayed.

Flags

-s source_selection_string
Specifies that only resources of the source class that match the selection string are used in the search for associated resources.
-S destination_selection_string
Specifies that only resources of the associated classes that match this selection string are displayed.
-c association_class
Limits the association search to only those resources tied to the source class through association_class.
-d association_endpoint
Limits the search of associated resources to just the members of this class.
-o role
The CIM association interface defines the role parameter as the name of the property referring to the class on the source side of the association. Typical values for this parameter are "GroupComponent" or "PartComponent", though the specific name must come from the association class definition.
-R result_role
Used like the -o flag, except this is the name of the property that refers to the destination side of the association.
-h
Writes the command usage statement to standard output.
-T
Writes the command trace messages to standard error. For your software service organization use only.
-V
Writes the command verbose messages to standard output.

Standard output

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

Standard error

When the -T flag is specified, this command trace messages are written to standard error.

Exit status

0
The command ran successfully.
1
An error occurred with the command-line interface (CLI) script.
2
An incorrect flag was specified on the command line.
3
An incorrect parameter was specified on the command line.
4
The source endpoint class was not found.
5
The destination endpoint class was not found.
6
The association class was not found.

Implementation specifics

This command is part of the rsct.exp.cimrm fileset, in the rsct.exp package on the AIX® Expansion Pack and Reliable Scalable Cluster Technology (RSCT) package for the Linux® operating system.

Location

Item Description
/opt/rsct/bin/lsrsrcassoc  

Examples

To view instances of cimv2.IBMAIX_UnixProcess (for AIX) and cimv2.Linux_UnixProcess (for Linux) that are associated with cimv2.IBMAIX_OperatingSystem and cimv2.Linux_OperatingSystem respectively on the specified node, enter:

For AIX:
lsrsrcassoc -c cimv2.IBMAIX_OSProcess -s 'Name=~"c175nf14"' -S \
'Name=~"emacs"' cimv2.IBMAIX_OperatingSystem Handle Parameters
For Linux:
lsrsrcassoc -c 
cimv2.Linux_OSProcess -s 'Name=~"c175nf14"' -S \
'Name=~"emacs"' cimv2.Linux_OperatingSystem Handle Parameters
In these examples:
  • -c cimv2.IBMAIX_OSProcess and -c cimv2.Linux_OSProcess are the association classes whose provider is used.
  • -s 'Name=~"c175nf14"' is the selection string against the cimv2.IBMAIX_OperatingSystem and cimv2.Linux_OperatingSystem instances (we only want objects associated with the OS instance representing the node c175nf14).
  • -S 'Name=~"emacs"' is the selection string against cimv2.IBMAIX_UnixProcess and cimv2.Linux_UnixProcess objects; only those with Name attributes that contain the pattern emacs are returned.
  • cimv2.IBMAIX_OperatingSystem and cimv2.Linux_OperatingSystem, which are the "source object" parameter, are one of the classes in the association.
  • Handle Parameters are properties that the provider is asked to return. Handle is the PID of the process; Parameters is a list of arguments to the process.
The following output is displayed:
Resource Persistent Attributes for cimv2.IBMAIX_UnixProcess (or cimv2.Linux_UnixProcess)
resource 1:
Handle = "2781"
Parameters = {"emacs", "-u", "foo.C"}
resource 2:
Handle = "2782"
Parameters = {"emacs", "bar.C"}
resource 3:
Handle = "2783"
Parameters = {"emacs","foo_bar.C"}
resource 4:
Handle = "2784"
Parameters = {"emacs","bar_foo.C"}
resource 5:
Handle = "2785"
Parameters = {"emacs","CIMRC.C"}
resource 6:
Handle = "26994"
Parameters = {"emacs","lsassocmap.pl"}