Sun Management Center 3.6.1 User's Guide

Basic CLI Commands

The following list describes the basic CLI commands.

alias

Description

The alias command creates 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).

When the user quits a CLI session, the aliases that the user has specified are stored in a file in the aliases directory. These aliases will be available when the user logs in to the CLI session.

Syntax

alias [<pseudonym>="command [parameters]"]

Examples


> 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
attrib

Description

The attrib command retrieves the attributes of a topological object.

Syntax

attrib [group=groupName [name=attribName] [-key]]

browse

Description

The browse command activates the browsing mode of the topology.

Syntax

browse

cd

Description

The cd command changes the current topological path. If no path is specified, the current path will be set to the default domain. If a number (n) is specified, the current path will be set to the nth child path, as shown by the list command.

Syntax

cd [path|number]

clear

Description

The clear command removes all parameters that were set during the current session. However, this command will not remove parameters that were set from the command line. This command is similar to the unset command but does not require parameter names as arguments.

Syntax

clear

data

Description

The data command shows the details of a topological object. If a number (n) is specified, the path will be set to the nth child path, as shown by the list command.

Syntax

data [path|number|-key]

end

Description

The end command deactivates the browsing mode of the topology.

Syntax

end

exit

Description

The exit command terminates your server connection and the CLI session.

Syntax

exit [-onError]

Parameter

onError

The onError parameter is used to terminate the CLI session if an exception occurs in the execution of the previous command. This parameter is used only in batch mode.


Note –

The exit command and the quit command are identical.


goto

Description

The goto command navigates to a topological path that matches the case-sensitive pattern. If more than one matching path is found, the user is asked to choose a path.

Syntax

goto <pattern>

help

Description

The help command displays information about CLI commands and their parameters. The help information is suitable for displaying on a terminal screen that is not bitmapped. When help is executed without an argument, the help displays an alphabetical list and a brief description of available CLI commands. Basic commands are listed first, followed by extended commands.

Syntax

help [-e][-h] [<command>|about|legal]

Parameters

-e, -h, command, about, and legal

-e displays the help text in extensive mode. The following format is also supported: <command> -e.

-h displays the help text in normal mode. The following format is also supported: <command> -h.

command displays information specific to that command.

about displays the version information about CLI.

legal displays the licensing terms of the CLI.

Example

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]
history

Description

The history command lists or executes the previously entered commands in the CLI session. When the history command is called without any argument and history was set earlier, all the previously entered commands will be listed. When the history command is called with a numerical argument and history was set earlier, the command that matches this argument will be executed.

Syntax

history [num]

kill

Description

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

Syntax

kill

list

Description

The list command lists the objects under a path. If a number (n) is specified, the path will be set to the nth child path as shown by this command.

Syntax

list [path|number]

locate

Description

The locate command finds all the topological paths that match the specified pattern. The pattern is case sensitive.

Syntax

locate <pattern>

login

Description

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. If no port is specified, 2099 is used. The login command also prompts you for your user name and password.

Syntax

login [serverHost=host] [serverPort=portNumber] [user=userName] [password=userPassword]

Parameters

serverHost, serverPort, user, and password

logout

Description

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

Syntax

logout

print

Description

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 append or o are set, the output is directed to the file that is specified by those parameters. The output is not shown on the screen. if ncols is not specified, the default number of columns is set to 4.


Note –

The print command is not saved in the command history.


Syntax

print [f=plain|xml|html] [style=table|list|<custom>] [columns= columnList] [ncols=num] [o=outputFile | append=appendFile]

Parameters

f, style, columns, ncols, o, and append

quit

Description

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


Note –

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


Syntax

quit

reset

Description

The reset command restores the values of all parameters that are specified at 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 at the command line remain unchanged. If a specific parameter name is supplied as an argument to reset and the parameter was specified at 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.


Syntax

reset [<parameter>]*

set

Description

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 that are 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.

Syntax

set [<parameter>[=value]]* [height=num] [history=num] [log=file] [logmode=detailed|command|"from n"] [more=on|off] [prompt=prompt]

Example

The following example shows all three variations of this command.


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

Description

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

Syntax

status

unalias

Description

The unalias command removes the alias or a list of aliases that was specified as an argument.

Syntax

unalias [<pseudonym>]*

unset

Description

The unset command removes the specified parameter(s) from the current session.

Syntax

unset [<parameter>]*


Note –

The unset command is not saved in the command history.


where

Description

The where command displays the current topological path.

Syntax

where