Sun Management Center 3.5 User's Guide

Chapter 20 Using the Command-Line Interface

The Sun Management Center command-line interface (CLI) is a lightweight, character-driven console alternative to the Java and web console graphical interfaces for monitoring and managing your system.

The following topics are discussed in this chapter:

Overview of the Sun Management Center CLI

The Sun Management Center command-line interface (CLI) is a character-driven console application for monitoring and managing your system. The CLI offers several useful features:

You can use the CLI to perform the following tasks:

System Requirements

You can access the CLI from a user terminal session on one of the following system configurations:

CLI Interaction Modes

The CLI supports the following two interaction modes:

CLI Command and Parameter Overview

This section provides an overview of CLI commands and parameters.

CLI Command Overview

CLI commands can be divided into two types: basic commands and extended commands.

In session mode, commands execute in either the foreground or the background.

The CLI also supports aliases. You can define a shorthand term or pseudonym for a more complicated command and its parameters. User-defined aliases persist across different CLI sessions.

CLI Parameter Overview

CLI parameters are name-value pairs: each parameter has a name and a value. Some parameters are built-in to the CLI. Their names and the significance of their values are predefined within the CLI. You can define other parameters, also known as variables. Some parameters are global in scope. Global parameters affect the execution of all CLI commands that are run in a particular session. Other parameters are specific to a certain command or group of commands.

Input and Output Capabilities

The CLI provides several capabilities for input and output.

CLI Command Help

The CLI provides online help for each CLI command. CLI help is available from within the CLI. CLI help does not require a GUI. For each command, the help provides a synopsis of command usage and a list of the parameters associated with that command.

CLI Parameters

Most CLI parameters are name-value pairs: each parameter has a name and a value. A few parameters have names but no values. These parameters are known as flags.

Scope of Parameters

You can specify parameter values at several points in a CLI session:

Parameter Syntax

Parameters are specified as name=value pairs:

file=/home/examples/example1

where the parameter name is file and the parameter value is /home/examples/example1. There must be no whitespace between the equals sign (=) and the parameter name or parameter value. If the value contains whitespace such as a space or tab character, the value must be enclosed in double-quote characters (ASCII character 0x22):

moduleDesc="Local File Scanning"

Parameter values can be a list of comma-separated values. There must be no whitespace between the comma-separated values, as shown in the following example.

severity=DIS,DWN,ERR

A parameter list is a sequence of parameters separated by whitespace, as shown in the following example.

m=kernel-reader moduleDesc="My Kernel Reader"

Examples of Acceptable and Unacceptable Parameter Syntax

The following parameters have acceptable syntax:

ok1="This is just a test"
ok2=hello
ok3=hello,hi,aloha
ok4="hello,hi,aloha"

The following parameters do not have acceptable syntax:

broken1="How are you?","Who are you?"
broken2="Testing",1,2,3
broken3="Hello
broken4=Hello"

Parameter Input File Format

Parameters can be stored in a file and read when needed. You can create as many parameter files as needed. Use the built-in i parameter to specify the name of the desired parameter input file.

Predefined Parameters and Flags

This section describes parameters that have predefined meanings within the CLI.


Note –

Several predefined parameters have single-letter names. Some examples include such as a, f, and o. These are correct parameter names and are not errors.


-b

When included on the UNIX command line when the CLI is started, this flag instructs the CLI to run in batch mode. This flag is ignored in session mode.

-h

When this flag is used as a parameter to a command in session mode, it instructs the CLI to display the help text for the command.

-l

The name of this flag is the lowercase letter l (ASCII character 0x6c), not the numeral 1 (ASCII character 0x31). When this flag is used as a parameter to an extended command in session mode, it instructs the CLI to retain the parameters from the last extended command while executing the current command. If the -l flag is specified, any additional parameters specified for the current command are ignored. This flag has no effect on basic commands. The following example illustrates usage of the -l flag:


> getLoadModules a=myHostName
...
...
> getAlarms -l

When the getAlarms command executes, the command uses the value of parameter a (myHostName) from the previously executed getLoadModules command.

a

The value of the a parameter is an agent, which is specified as the agent host and (optional) port number. If you specify the port number, separate the number from the host name by a colon (:). The general syntax is a=agentHost[:agentPort]. For example, to specify an agent running on host example_host and listening to port 12345, you would use the following syntax:


a=example_host:12345

The value of the a parameter can also be a comma-separated list of agent specifications: a=agent[,agent]+.

append

The value of the append parameter is the name of a file to which the output of a command should be appended. If this file does not exist, the file is created. If you set the append parameter globally, all command output for that session is appended to the specified file. You can also set this parameter for a specific command, as shown in the following example.


append=/home/examples/cli_output

If both the append and o parameters are set, append takes precedence over o. Only command results are recorded in the specified file. The actual command is not recorded. Use the log parameter to record command information.

columns

The value of the columns parameter is the name of one or more columns of command output to be displayed by the print command. Column names are case-sensitive. Multiple column names are separated by commas. The following example uses several column names.


columns="Alarm Id,Node URL,Target Host,Severity"
f

The value of the f parameter determines the format of command output. The current formats are plain and html. See Command Output Format for more information. To set the format to HTML, use the following syntax:


f=html
height

The value of the height parameter is the number of lines of command output to display on the screen. The following example sets the height to approximately the height of a standard terminal screen:


height=24
i

The value of the i parameter is the name of an input file that contains parameter definitions to be included in the current session. Within the input file, each parameter definition should be on a separate line. For example, assume that the following lines are in a /home/examples/myParams file:


more=off
serverHost=myserver
a=myagent:161

You could include these parameters in the current CLI session by using the following line:


i=/home/examples/myParams
log

The value of the log parameter is the name of a file that records all CLI commands and the time that the commands were executed. Note that the log file only records command names and time of execution. Command output is logged in files specified by the a or o parameters. Once the parameter is set, all subsequent commands are appended to the file. If this file does not exist, the file is created. Because the log file is not overwritten when logging is turned on, be sure to specify a different file if you want a different log. To turn logging off, unset the log parameter. The following example starts a log, then later stops the log.


> log=/home/examples/sunmc-log
...
...
> unset log
m

The value of the m parameter is the name of a Sun Management Center module. The value can also be a comma-separated list of modules.


m=kernel-reader
more

The value of the more parameter controls paging of command output on your display. Possible values are on and off. If more is set to on, all subsequent output to the terminal is displayed one screen at a time. The size of a screen is defined by the height and width parameters. Default values are off for batch mode and on for session mode.


more=on
o

The value of the o parameter is the name of a file to which command output should be written. If this file exists, the file is overwritten. You can use the o parameter to capture the output of a particular command by specifying the o parameter to that command. You can also set the parameter globally using the set command to write all subsequent output to a file.

If both the append and o parameters are set, append takes precedence over o. Output is appended to the specified file. Only command output is written to the file. The actual command is not recorded. Use the log parameter to record command information. The following example defines a file into which command output is written.


o=/home/examples/sunmc-output
serverHost

The value of the serverHost parameter determines the server host to which the CLI connects at login. This global parameter cannot be changed once the CLI is connected to the server.

serverPort

The value of the serverPort parameter is the server port for login. This global parameter cannot be set after a login session is established. If this parameter is not set, the default port of 2099 is used.

t

The value of the t parameter is the name of an object that is managed in the topology agent. The object can be a domain, a view group, or an entity. The object name is the fully qualified name starting from the domain, for example, /domain/group/host.

CLI Commands

See CLI Command and Parameter Overview for an overview of command types and concepts.

Basic CLI Commands

The following list describes the basic CLI commands.

alias

Use the alias command to create an alias for frequently used commands or for commands that have complicated parameters. An alias cannot have the same name as an existing CLI command. Whitespace in an alias definition must be enclosed in double-quotes (", ASCII character 0x22). The following example shows a simple alias command first, followed by a more complex alias command.


> alias assign=set
> alias alarms="getAlarms severity=dwn"

If called without arguments, the alias command prints a list of defined aliases and their values. The following example shows the result of the alias command when the command is called without arguments.


> alias
assign - set
alarms - getAlarms severity=dwn
clear

The clear command removes all parameters from the current session. This command is similar to the unset command but does not require parameter names as arguments.

exit

The exit command disconnects from the server and terminates the CLI session.


Note –

There is no difference between the exit and the quit commands.


help

The help command displays information about CLI commands and their parameters. The help information is suitable for displaying on a non-bitmapped terminal screen. When help is executed without an argument, the help displays an alphabetical list and brief description of available CLI commands. Basic commands are listed first, followed by extended commands. When help is called with the name of a CLI command as an argument, help prints information specific to that command. The following example shows help for the getAlarms command.


> help getAlarms
getAlarms [a=host[,host]+] [alarm_filter_list]
 - Get alarm information on an agent or a list of agents under a
set of filter conditions. If no agent is provided, all alarms will
be obtained. All the filter conditions are "ANDED" to provide the
result. The filter conditions as specified in alarm_filter_list
comprises:
  domain=domain and/or
  m=module[+instance] and/or
  managed_object=managed_object and/or
  property=property and/or
  property_instance=property_instance and/or
  qualifier=qualifier and/or
  severity=[DIS,DWN,ERR,OFF,INF,IRR,WRN] and/or
  state=[C,F,O] and/or
  ack=[A,N]
kill

The kill command terminates any commands that are running in the background.

login

The login command establishes a connection to a Sun Management Center server. You can specify the serverHost and, optionally, serverPort parameters as arguments. If no host is specified, you are prompted for a host. The login command also prompts you for your username and password.

logout

The logout command terminates your connection to the Sun Management Center server, but does not terminate the CLI session.

more

The more command displays help information on the parameters that you set to control the format of command output to the screen. Refer to the discussion of the predefined parameters height and more in Predefined Parameters and Flags for additional information.

print

The print command directs the output of the last extended command in the specified format to the specified destination. By default, print directs this output to the terminal screen in plain text format. If the parameters a or o are set, the output is directed to the file specified by those parameters. The output is not shown on the screen.


Note –

The print command is not saved in the command history.


quit

The quit command disconnects from the server and terminates the CLI session.


Note –

There is no difference between the quit and the exit commands.


reset

The reset command restores the values of all parameters that are specified on the command line to the values that were specified at the beginning of the CLI session. Parameters that were defined during the session but not on the command line remain unchanged. If a specific parameter name is supplied as an argument to reset and the parameter was specified on the command line, that parameter's value is restored to its original value. Otherwise, the parameter's value remains unchanged.


Note –

The reset command is not saved in the command history.


set

The set command enables you to specify parameter values or to display parameter values. Parameters whose values are specified with the set command are global to the current session. Global commands are available to all commands during that session. If you execute set with no arguments , the value of all parameters defined during the current session are displayed. If you execute set with a parameter that is specified as an argument, the value of that parameter is displayed. The following example shows all three variations of this command.


> set height=10
> set
height=10
> set height
height=10
status

The status command displays the status of any commands that are running in the background.

unalias

The unalias command removes the alias that was specified as an argument.

unset

The unset command removes the specified parameters from the current session.


Note –

The unset command is not saved in the command history.


Extended CLI Commands

Several types of extended commands that are available in the CLI are described in these sections:

Module Extended Commands

There are seven extended commands for managing modules. For details about the a, m, f, and columns parameters, refer to Predefined Parameters and Flags.

Module Commands

disableModule

Disable a module or modules in an agent or agents. The disableModule command takes the following parameters: a and m

enableModule

Enable a module or modules in an agent or agents. The enableModule command takes the following parameters: a, f, m, and columns.

getLoadedModules

Get a list of loaded modules in an agent or agents. The getLoadedModules command takes the following parameters: a, f, and columns.

getModule

Get information for a particular module. The getModule command takes the following parameters: a, f, m, and columns.

getModules

Get a list of modules in an agent. The getModules command takes the following parameters: a, f, and columns.

loadModule

Load a module in an agent or agents. The loadModule command takes the following parameters: a, f, m, and columns.

The loadModule command can take two additional parameters: moduleName, which is the internationalized module name, and moduleDesc, which is a text description of the module.

unloadModule

Unload one or more modules in an agent or agents. The unloadModule command takes the following parameters: a, f, m, and columns.

Module Command Examples

To determine which modules are loaded on a host whose agentHost name is seattle, you would type the following command at the CLI prompt:


> getLoadedModules a=seattle

To load the kernel-reader module on the host seattle at port 1776, you would type the following command:


> loadModule a=seattle:1776 m=kernel-reader

Object Attribute Extended Commands

There are four extended commands for managing object attributes and attribute values.

Parameters for the Object Attribute Command

The following parameters can be used by the object attribute commands. For details about the a, m, f, and columns parameters, refer to Predefined Parameters and Flags.

mgtObj

The value of the mgtObj parameter is the name of the managed object whose attributes and properties are being set or retrieved.

property

The value of the property parameter is the name of the property whose attributes and values are being set or retrieved.

propInst

The value of the propInst parameter is the name of the instance of the property whose attributes and values are being set or retrieved.

rowValues

The value of the rowValues parameter is a comma-separated list of name-value pairs. name is the name of a column in the row. value is the value in that column.

attributes

The value of the attributes parameter is a comma-separated list of attribute names that belong to the property whose attributes and values are being set or retrieved. When used with the setAttributes command, each attribute name in the attributes parameter must have a corresponding value in the values parameter.

values

The value of the values parameter is a comma-separated list of values that correspond to the attributes that are specified in the attributes parameter. When used with the setAttributes command, there must be a value for each attribute specified.

Object Attribute Commands

You can set and retrieve object attributes and attribute values with the following commands:

addRow

The addRow command adds a row to a table. The addRow command takes the following parameters: a, m, mgtObj, property, propInst, and rowValues.

delRow

The delRow command deletes a row from a table. The delRow command takes the following parameters: a, m, mgtObj, property, propInst, and rowValues.

getAttributes

The getAttributes command retrieves the specified attributes from an agent or a list of agents. The getAttributes command takes the following parameters: a, f, m, columns, mgtObj, property, propInst, and attributes.

setAttributes

The setAttributes command assigns values to the specified attributes in an agent or a list of agents. The setAttributes command takes the following parameters: a, m, mgtObj, property, propInst, attributes, and values.

For each attribute specified in the attributes parameter, there must be a corresponding value in the values parameter.

Examples for the Object Attribute Command

The following command retrieves all attributes for the size property in the totalstats managed object in the agent-stats module at port 1161 on host haiku:


> getAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size

The following command sets the attribute alarmlimits.error-gt to the value of 2 in the size property specified in the previous example:


> setAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size attributes=alarmlimits.error-gt values=2

The following command deletes the row that is specified in rowValues from the managed object that is specified in mgtObj:


> delRow a=haiku:1161 \
m=filemon mgtObj=filemonstats/filemonTable/filemonEntry \
rowValues="name=test,desc=this,filename=/etc/passwd"

Alarm Extended Commands

There are five extended commands for managing alarms.

Alarm Command Parameters

The following parameters can be used by the extended commands for alarms. For details about the a and m parameters, refer to Predefined Parameters and Flags.

ack

The value of the ack parameter is a comma-separated list of values that indicate whether the alarms being managed have been acknowledged. Legal values for the ack parameter are A (Acknowledged) and N (Not Acknowledged).

command

The value of the command parameter is the alarm action to be performed.

domain

The value of the domain parameter is the name of the Sun Management Center domain for which alarms are to be managed. If no domain is specified, the Default Domain is used.

managed_object

The value of the managed_object parameter is the name of the managed object for which alarms are to be managed.

note

The value of the note parameter is a text annotation for the command being run.

property

The value of the property parameter is the name of the property for which alarms are to be managed.

property_instance

The value of the property_instance parameter is the name of the specific property instance for which alarms are to be managed.

qualifier

The value of the qualifier parameter is the name of the qualifier that is associated with the managed property whose alarms are to be managed.

severity

The value of the severity parameter is a comma-separated list of severity values for the alarms being managed. The following values are allowed for the severity parameter:

  • ERR — Error

  • WRN — Warning

  • INF — Informative

  • IRR — Irrational

  • DWN — Down

  • DIS — Disabled

  • OFF — Off

state

The value of the state parameter is a comma-separated list of state values for the alarms being managed. Legal values for the state parameter are O (Open) or C (Closed).

Alarm Commands

You can examine alarm values and set alarm actions with the following commands:

ackAlarms

The ackAlarms command acknowledges alarms in an agent or a list of agents. The ackAlarms command takes the following parameters: a, ack, columns, domain, f, m, managed_object, note, property, property_instance, qualifier, severity, and state.

If no value is specified for the state parameter, state defaults to O (Open).

delAlarms

The delAlarms command deletes alarms in an agent or a list of agents. The delAlarms command takes the following parameters: a, ack, columns, domain, f, m, managed_object, note, property, property_instance, qualifier, severity, and state.

If no value is specified for the state parameter, state defaults to C (Closed).

getAlarms

The getAlarms command retrieves alarm information for an agent or a set of agents. The getAlarms command takes the following parameters: a, ack, columns, domain, f, m, managed_object, property, property_instance, qualifier, severity, and state.

If no parameters are specified, getAlarms returns all alarm information.

runAlarmAction

The runAlarmAction command runs a manual or delayed alarm action in an agent or a list of agents. The runAlarmAction command takes the following parameters: a and domain

setAlarmAction

The setAlarmAction command sets a manual or delayed alarm action for an existing alarm in an agent or a list of agents. The setAlarmAction command takes the following parameters: a, command, and domain.

Alarm Command Examples

The following command retrieves all alarms with severity of ERR or DWN from the host haiku:


> getAlarms a=haiku severity=ERR,DWN

Topology Extended Commands

There are nine extended commands for managing topology.

Topology Command Parameters

The following parameters can be used by the extended commands for topology. For details about the a, columns, f, and t parameters, refer to Predefined Parameters and Flags.

agentPort

The value of the agentPort parameter is the agent port number. If agentPort is not specified, the default value of 161 is used. The agentPort parameter is optional. This parameter is only specified if the url parameter is not specified and if you do not want the default port.

arch

The value of the arch parameter is the architecture of the topology object.

domain

The value of the domain parameter is the name of the Sun Management Center domain that you must specify for the setCurrentDomain command.

family

The value of the family parameter is the object family of the topology object.

fullDesc

The value of the fullDesc parameter is a text description of the entity or group being created.

isPolled

The value of the isPolled parameter can be true or false. If the value is true, the entity polls for status information according to the polling type (pollType).

pollType

The value of the pollType parameter is the type of polling for this entity. The following values are allowed for the pollType parameter:

  • ahost – Identifies a host on which an active agent is installed and running

  • amod – Identifies a module that has an active agent

  • aprox – Identifies an agent that is running an SNMP proxy module

  • dummy – Identifies a device that is not monitored

  • ping – Identifies a host to be monitored using the ICMP ping command

  • snmp — Identifies a host to be monitored using the SNMP ping command

readInfo

The value of the readInfo parameter is the name of the SNMPv1 read community for SNMP polled objects.

targetHost

The value of the targetHost parameter is the name of the target host.

targetIp

The value of the targetIP parameter is the IP address of the target host.

topoCfg

The value of the topoCfg parameter is configuration information for the topological representation of a managed entity.

topoType

The value of the topoType parameter is the topological representation type of a managed entity.

url

The value of the url parameter is the URL of the entity to be polled. The value of the url parameter can be specified in the following formats:

ping://hostname
snmp://hostname:port/oid/#.#.#.#
snmp://hostname:port/[mod,sym]/path
writeInfo

The value of the writeInfo parameter is the name of the SNMPv1 write community for SNMP polled objects.

Topology Commands

There are nine extended commands for managing topology.

createEntity

The createEntity command creates a managed entity. Properties of the managed entity are specified with the following parameters: agentPort, arch, family, fullDesc, isPolled, pollType, readInfo, targetHost, targetIP, topoCfg, topoType, url, columns, f, and t.

If the url or agentPort parameters are specified, the default port of 161 is not used.

createGroup

The createGroup command creates a topology domain or group. If the entity being created is a group, the group properties are specified with the following parameters: family and fullDesc. The createGroup command also takes the following parameters: columns, f, and t.

If the entity being created is a domain, the family and fullDesc parameters are ignored.

delTopoObjects

The delTopoObjects command deletes a managed topology object in the managed topology hierarchy. All objects under the specified topology object are deleted as well. The delTopoObjects command takes the following parameters: columns, f, and t.

getAgentPort

The getAgentPort command returns a port number of the Sun Management Center agent running on the specified host in a topology domain. If there are multiple agents, a list of port numbers is returned. The getAgentPort command takes the following parameters: columns, f, and t.

If t is not specified, the default domain is used.

getAllTopoObjects

The getAllTopoObjects command returns a list of all managed objects in the managed topology hierarchy that satisfy conditions specified by the arch, family, or pollType parameters. The getAllTopoObjects command also takes the following parameters: columns, f, and t.

getCurrentDomain

The getCurrentDomain command returns the name of the current domain.

getDomains

The getDomains command returns a list of all managed domains.

getTopoObject

The getTopoObject command returns a list of managed topology objects directly under the topology object specified by parameter t that satisfy conditions specified by the arch, family, or pollType parameters. The getTopoObject command also takes the following parameters: columns and f.

setCurrentDomain

The setCurrentDomain command sets the home domain to the value specified in the domain parameter.

For information about exporting and importing topology information from the CLI, see Import and Export CLI Interface.

Topology Command Examples

The following command returns a list of all Sun Management Center agent hosts on the sun4u family in group building12 in the menlo_park domain that are running SunOS 5.7 software:


> getTopoObject t=/menlo_park/building12 pollType=ahost \
arch="SunOS 5.7" family=sun4u

The following command creates a group that is named building19 under an existing domain that is named headquarters_test:


> createGroup t=/headquarters_test/building19 \
fullDesc="test headquarters domain" family=building-location

The following command creates a managed entity that is named myHost in the group building12 in the domain test_domain. The topology object is a Sun Ultra-2 host with the agent running in port 1161.


> createEntity t=/test_domain/building12/myHost \
fullDesc="my test host" family=ultra-2 topoType="" \
topoCfg="" isPolled=false pollType=ahost readInfo="" \
writeInfo="" targetHost=osftserv targetIp="" agentPort=1161

CLI Output

The CLI provides the following output options:


Note –

All commands and log files are available only in English. However, command descriptions and help text follow the Java internationalization guidelines for languages other than English.


Command Output Format

The output of basic commands is available only in plain text. Refer to CLI Command and Parameter Overview for an explanation of basic and extended commands.

The output of extended commands is available in two formats:

To specify the output format, set the f parameter to the value of the desired format. Currently supported values are plain and html.

You can define a logical screen size for command output by setting the height parameter to a desired value. You can set the more parameter to display output one screen at a time. See Predefined Parameters and Flags for an explanation of these parameters.


Example 20–1 Plain Text Command Output

The following example shows the partial output of the getLoadedModules command in plain text.


== getLoadedModules: Results 1/16 ===============================
Module Name=Dynamic Reconfiguration
Module Key=dr
Description=Dynamic Reconfiguration (Sunfire)
Agent Name=myhost-dev86
Agent Port=161
Version=2.0
== getLoadedModules: Results 2/16 ===============================
Module Name=Config-Reader(sun4u/sun4d)
Module Key=Config-Reader4u
Description=Config Reader (sun4u/sun4d)
Agent Name=myhost-dev86
Agent Port=161
Version=1.0
...
== getLoadedModules: Results 15/16 ==============================
Module Name=DNS Synthetic Transaction [dns]
Module Key=dnsST+dnstest
Description=DNS Synthetic Transaction
Agent Name=myhost-dev86
Agent Port=161
Version=1.0
================================================================

CLI Log File

To record CLI commands in a log file, set the log parameter to the name of the file in which to record the commands. The log file has the following format:

DATE & TIME;duration or message;command and parameters

Example 20–2 Partial CLI Log File

The following example is an excerpt of the log of the command sequence from which the previous getLoadedModules command output was obtained.

Fri Dec 21 14:15:12 PST 2001;0 second;set o=\
/home/examples/output.3c23b455
Fri Dec 21 14:15:23 PST 2001;0 second;set f=plain
Fri Dec 21 14:15:45 PST 2001;0 second;set a=smtg-dev21
Fri Dec 21 14:16:08 PST 2001;== START OF THREAD ==;getLoadedModules
Fri Dec 21 14:16:08 PST 2001;2 seconds;getLoadedModules
Fri Dec 21 14:16:12 PST 2001;9 seconds;print
Fri Dec 21 14:21:28 PST 2001;== START OF THREAD ==;getAgentPort
Fri Dec 21 14:21:28 PST 2001;0 second;getAgentPort
Fri Dec 21 14:21:31 PST 2001;0 second;print
Fri Dec 21 14:22:01 PST 2001;0 second;exit

CLI Procedures

This section describes some common CLI procedures.

To Access the CLI in the Solaris Operating Environment
  1. To begin an interactive session, type the command /opt/SUNWsymon/sbin/es-cli followed by any desired global parameters.

  2. Type login in response to the CLI prompt (>).

  3. Type the name of the host to which you wish to connect in response to the Host prompt.

  4. Type your login name and password in response to the Login and Password prompts.

    The result of steps 1-4 resembles the following example:


    /opt/SUNWsymon/sbin/es-cli parameters
    > login
    Host: myhost
    Login: mylogin
    Password: mypassword
    Login is successful.
    >

    Tip –

    You can run the CLI in batch mode using a previously prepared file of CLI commands as input by using the following command: /opt/SUNWsymon/sbin/es-cli -b file.


To Access the CLI in Microsoft Windows Environments
  1. After you have installed the Sun Management Center console layer, double-click es-cli in the CLI folder.

    The CLI screen is displayed.

  2. Type the login command.

    The login process prompts you to specify the desired host name and your login name.

    In the following example, seattle is the host, and susan is the login name:


    > login
    Host: seattle
    Login: susan
    Password:
    >
To Access CLI Online Help
  1. To obtain a list of all available CLI commands, type help at the CLI prompt.

  2. To obtain a more detailed explanation of a particular command, type help followed by the name of the command.

    For example, to obtain additional help about the getLoadedModules command, you would type:


    > help getLoadedModules
    
To Control Command Output Screen Size
  1. Define a screen size by setting the height parameter to the number of lines to display.

    For example, to define a screen 20 lines high, you would type:


    > set height=20
    
  2. To enable output to be viewed one page at a time, set the more parameter to on.


    > set more=on
    
To Record CLI Commands in a Log File
  1. Set the log parameter to the name of the file in which to record the commands.


    > set log=/home/examples/log.3c254030
    

    Once the log parameter is set, all subsequent commands are appended to the file. If this file does not exist, the file is created.

    The file is not overwritten, so make sure a new file is created if you want a new set of records.

  2. To stop recording, unset the log parameter.


    > unset log
    
To Record Command Output in a File
  1. To record command output in a file, set the o parameter to the name of the output file.


    > set o=/home/examples/output.3c254030
    

    To stop recording, unset the o parameter.


    > unset o
    
To Terminate a CLI Session
  1. To terminate a CLI session, type exit.


    > exit