Sun Management Center 3.6.1 User's Guide

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.


-b

When included at the 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

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 is executed, 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]*.

about

The about parameter is used with the help command. This parameter displays the version information for CLI.

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
history

The value of the history parameter is the number of commands to be stored in the command history. The command history allows the user to view the previously executed commands. This parameter is used by the set command.


history=10
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 records only 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, specify a different file if you want a different log. To turn logging off, use the unset command with the log parameter. The following example starts a log, then later stops the log.


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

The value of the logmode parameter can be detailed, command, or from n. The value of detailed stores detailed information of commands in the command log file. The value of command stores only the commands and the respective parameters in the command log file. The value of from n appends all the entries (starting from the nth entry) in the command history to the command log file. The default value of the logmode parameter is detailed.

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
ncols

The value of the ncols parameter is the maximum number of columns of command output to be displayed by the print command.

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
prompt

The value of the prompt parameter is used to set a different CLI prompt.

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.

style

The value of the style parameter determines the style of command output. The allowed values of this parameter are table, list, and <custom>. The table value displays the output in a tabular format. The list value displays the output in a list with the columns separated by a comma. The <custom> value ensures that the output is displayed in a user-defined format. Each column is represented by %a. The custom value can contain special characters such as :, \t, and \n.

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 at the domain level, for example, /domain/group/host.