lssys command

Use the lssys command to retrieve system attribute information.

Synopsis

smcli [-c] [-prompt] [-user user_name] [-pw password] lssys options

smcli lssys [-h | -? | --help]

smcli lssys [-v] [-I]

smcli lssys [-v] [-t system_type] [-d symbol] [-o | -p] [-T] [-A attribute_list [-s] | -F | -l [-e]] {-f file_name | -w query | -i ip_address_list | -N group_list | [-n] system_list}

Description

If you do not specify any targeting options, this command lists all systems.

If you do not specify any display options, this command lists only system names. Note that system names might not be unique.

Important: The -i | --listtype option is used to target systems by IP address or host name.

Operands

This command uses a list of systems as an operand. The list can optionally be preceded by the -n | --names option.

Options

-A | --attribute key[,key ... ]
so

Displays values for one or more specified attributes, where key is the attribute key.

Tips:
  • Separate the keys with commas.
  • The attributes and attribute values are not locale specific.
  • You can use the lsuser -l command to list all attributes associated with the targeted systems.
-d | --delimiter symbol

Specifies the character or set of characters that separates output data, where symbol is a string of one or more characters.

Tip: If the delimiter contains spaces, enclose it in quotation marks.
The behavior of this option depends on the use of other options in the command, as shown below.
  • If you specify this option without the -A | --attribute option, this command separates data fields in a record by a comma followed by a space. Data records are separated by the specified delimiter symbol.
  • If you specify this option with the -A | --attribute option, this command separates data fields in a record by the specified delimiter symbol. Data records are separated by a line break.
  • If you specify this option with the -F | --format or -l | --long option, the delimiter option is ignored.
-e | --expand
Expands the long listing to also display a description of the attribute keys.
Note: If you specify this option, you must also specify the -l | --long option.
The information is displayed in this format:
     key1 (key_string) : value1
     key2 (key_string) : value2
     ...
-f | --file {file_name | -}
Retrieves data either from the input file file_name or from input piped from another command.

To retrieve input piped from another command, specify a hyphen (-) instead of a file name (for example, smcli cmd1 | smcli cmd2 -f -). To retrieve input from a file, specify the full path. If the path contains spaces, enclose it in quotation marks.

The input data is the list of system names and IDs, separated by commas or line breaks.
-F | --format
Displays the output in a format that can be saved as a system definition file or used as input for the mkmo -f command. Although the actual attributes displayed varies with different system types, the format might resemble the following lines:
type = value 
ip = value 
name = value 
network = value 
Tip:
  • If you specify either the --oid or --pipe options, they are ignored.
  • You can use this option to save the definition of one or more systems, so that they can be restored at a later time.
-h | -?
Displays the syntax and a brief description of the command.
Tip: If you specify additional options other than -h | -? | --help, the options are ignored.
--help
Displays detailed information about the command, including the syntax, a description of the command, a description of the options and operands, error codes, and examples.
Tips:
  • If you specify additional options other than -h | -? | --help, the options are ignored.
  • You can also display detailed help in the form of man pages using the man command_name command.
-i | --ipaddress {ip_address | host_name}[,{ip_address | host_name}...]
Targets one or more systems, specified by IP address or host name.

The list can be a mixture of IP addresses and host names, separated by a comma.

ip_address
The IP address of the system.
Tips: Tips:
  • oYou can enter smcli lssys -A IPv4Address to list the IP address (either the IPv4 or IPv6 format) of each discovered system.
host_name
Either the host name or the host name and Domain Name System (DNS) suffix of the system. If the host name contains spaces, enclose it in quotation marks. If it contains a comma, prefix the comma with a backslash (\).
Tips: Tips:
  • oYou can enter smcli lssys -A Hostname to list the host name of each discovered system.
  • oThe host names are not locale specific.
  • oA given IP address or host name might resolve multiple systems. For example, both the OperatingSystem and Server instance of a particular system will have the same host name. Use system Object ID (option -n) to target a system uniquely.
-I | --listtype
Lists all system types. All additional options are ignored.
-l | --long
Displays all attributes for the targeted systems.
This option lists values for each system in this format:
system_name
      attribute_key: value
      attribute_key: value
      ...
Tip:
  • The attributes and attribute values are in English only. They are not locale specific.
-n | --names {system_oid | system_name}[,{system_oid | system_name}...]
Targets one or more systems specified by name or ID.

The list can be a mixture of system names and IDs, separated by a comma and containing no blank spaces.

If the -n option is not specified, then a customized event action that starts a noninteractive task on the system on which the event occurred is created. If the -n option is specified, then a customized event action that starts a noninteractive task on a specified system is created.

Important: You must provide the host name and the system name when you pass the parameter -n. The system name must not be equal to the host name. Therefore, you must pass the exact system name -n, which is not equal to the host name.
system_oid
The unique ID of the system, specified as a hexadecimal value prefixed with 0x (for example, 0x37) or a decimal value (for example, 123).
Tip: Use the smcli lssys -o command to list all system IDs.
system_name
The name of the system. If the system name contains a comma, prefix the comma with a backslash (\).
Tips:
  • The system names might not be unique. This command acts on all systems with the specified name. Use the -v | --verbose option to generate a message when this command targets multiple systems with the same name. To target a particular system that has a name that is not unique, identify the system by specifying its unique, hexadecimal ID, or use additional target options to refine the selection.
  • Use the smcli lssys command without any options to list all system names.
  • The system names are not locale specific.
-N | --groups {group_oid | group_name}[,{group_oid | group_name}...]
Targets all systems in one or more specified groups that are identified by name or ID.

The list can be a mixture of group names and IDs, separated by a comma.

Tips:
  • If the same systems are members of more than one group, they are targeted only once.

  • To target all systems, specify the "All Systems" group.
group_oid
The unique ID of the group, specified as a hexadecimal value prefixed with 0x (for example, 0x3e7).
Tip: Use the lsgp -o command to list all group IDs.
group_name
The name of the group. If the group name contains spaces, enclose it in quotation marks. If it contains a comma, prefix the comma with a backslash (\) and enclose the name in quotation marks.
Tips:
  • Group names are unique.
  • Use the lsgp command without any options to list all group names.
  • The group names are not locale specific.
-o | --oid id

The ID for the resource that will have the configuration retrieved.

-p | --pipe

Displays only the unique IDs for the targeted systems instead of the name.

Tips:
  • IDs are displayed as hexadecimal values, prefixed with 0x (for example, 0x37).
  • When used alone, this option enables the output to be piped to other smcli commands.
  • This option cannot be used with the -o | --oid options.
  • You can combine this option with the -l | --long and -A | --attribute options.
-s | --sort
Sorts the output by the first specified attribute.
Tip: If you specify this option, you must also specify the -A | --attribute option. Otherwise, this option is ignored.
-t | --type system_type

Narrows the specified targeted systems to all systems of the specified type.

The system types are organized in a hierarchy in which child subtypes extend parent types. When you specify a parent type (for example, Platforms), its children (in this case, PhysicalPlatforms) are also targeted.

Tips:
  • This options is not a targeting option by itself. It must be used with another targeting option, such as -n | --names or -i | --ipaddress.
  • You can use this option in conjunction with other targeting options; however, this targeting option acts before all other targeting options.
  • Use the lssys -T command to obtain a list of valid system types.
  • The system types are not locale specific.
-T | --showtype
Lists the system type after the system name. By default, the system name and type are separated by a comma followed by a space.
-v | --verbose
Writes verbose messages to standard output.

If this option is not specified, this command suppresses noncritical messages.

-w | --where "string"
Targets one or more systems based on system attributes specified by string and lists systems based on the attributes.
string is a SELECT statement that uses the following format:
"key1=value1 [{AND | OR} key2=value2 [{AND | OR}key_n=value_n...]"
Note: Value is case-sensitive.

Enclose the SELECT statement in double quotation marks. If a value includes spaces, enclose the strings in single quotation marks.

System attributes might not be unique. Use the lssys -l command to list the available system attributes.

Tips:
  • Use logical operators AND or OR to combine attributes.
  • Use parentheses to create nested logical constructs.
  • Only system attributes can be specified. Use the lssys -l command to list the available system attributes.

Exit status

The following table lists the codes returned by this command.

  • 0: The operation completed.
  • 1: A usage error occurred.
  • 2: The command or bundle was not found.
  • 3: The command was not performed because either authentication failed or you are not authorized to perform the action.
  • 10: The file was not found.
  • 20: A specified system is not valid.
  • 21: A specified system group is not valid.
  • 25: A number-formatting error occurred.
  • 26: A specified system type is not valid.
  • 27: A specified attribute is not valid.
  • 29: The specified locale is not valid or not supported.

Examples

  1. List the names and IDs of all systems

    This example illustrates how to list the names and IDs of all systems.

    smcli lssys -o
    
    aixServer, 0x291
    webServer, 0x292
    mailServer, 0x295
  2. List all attributes for multiple systems

    This example illustrates how to list the attributes for systems with IP addresses 9.182.149.105 and 9.182.149.115, and host name myusmibox.raleigh.ibm.com.

    smcli lssys -l -i 9.182.149.105, 9.182.149.115, myusmibox.raleigh.ibm.com
  3. List systems with specific attributes

    This example illustrates how to list all systems that are based on POWER or IA32 architecture.

    smcli lssys -w "Architecture=POWER OR Architecture=IA32"

    This example illustrates how to list all systems that have AIX or i5 OS installed.

    smcli lssys -w "OSType=9 OR OSType=11"
  4. Sort systems by a specific attribute

    This example illustrates how to list the display name and resource-type attributes for all systems, and sorted by display name.

    smcli lssys -sA DisplayName,ResourceType
    
     aixServer, Server
     mailServer, Server
     webServer, Server