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:
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:
Low overhead – Although the CLI provides most of the functionality of the Java console and web console, the CLI does not require bitmapped graphics. The CLI therefore can run on simple data terminal equipment over low-bandwidth connections. However, features that require a GUI, such as physical views or graphing, are unavailable through the CLI.
Batch mode processing – The CLI supports a basic scripting functionality that enables the CLI to take command input from a file in batch mode.
Configurable output format – You can configure the format of CLI output. The plain-text output is compatible with other text-based tools. For extended commands, you can specify output in HTML.
Help – Online help for CLI commands is available from within the CLI.
You can use the CLI to perform the following tasks:
Create topology objects such as domains, groups, and entities, and retrieve topology information about these objects.
Retrieve and manipulate managed object properties or attributes.
Load, unload, enable, and disable modules on Sun Management Center agents.
Set and run alarm actions, retrieve alarm information, and acknowledge or delete alarms on Sun Management Center agents.
You can access the CLI from a user terminal session on one of the following system configurations:
UNIX® workstation running the Solaris 8 or Solaris 9 operating systems
PC running Windows 98, Windows 2000, or Windows NT
The CLI supports the following two interaction modes:
Session mode – Session mode is interactive. Once you log in to the Sun Management Center server, you can enter commands and receive output until you explicitly log out of the server.
Batch mode – The CLI connects to the server and executes the commands contained in filename, where filename is the name of a file that contains CLI commands.
This section provides an overview of CLI commands and parameters.
CLI commands can be divided into two types: basic commands and extended commands.
Basic commands are commands that modify the environment in which other CLI commands are executed. You use basic commands to set parameter values, define command aliases, check command status, or log in and log out of the server. Basic commands always execute in the foreground.
Extended commands are commands that interrogate or modify the topology of managed objects, their properties, and their attributes. You use extended commands to perform several functions:
Locate managed objects in the managed object topology
Enable or disable modules
Acknowledge or delete alarms
By default, extended commands run in the background. You can configure extended commands to run in the foreground.
In session mode, commands execute in either the foreground or the background.
Foreground – Commands that execute in the foreground run to completion. These commands send their output directly to the screen unless otherwise redirected. Only one command at a time can run in the foreground. Basic commands can only run in the foreground. Extended commands run in the background by default, but can be configured to run in the foreground.
Background – Commands that execute in the background run asynchronously and by default send no output or diagnostic messages to the screen. Output is buffered and can be displayed later by explicit request. Unlike the UNIX shells, only one extended command can run in the background at a time. While this command is running in the background, any number of basic commands can run in the foreground. By default, extended commands run in the background, although you can specify that extended commands run in the foreground. Basic commands cannot run in 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 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.
The CLI provides several capabilities for input and output.
Input
Output
For basic commands, output appears on the screen by default.
For extended commands, output is buffered in the background by default until you request that output.
The output of both basic and extended commands can be redirected to a file that you specify.
Commands and parameters can be saved in a log file that can later be used as input to the CLI in batch mode.
To use a log file as input to the CLI in batch mode, you must edit the file. Remove the time stamps and any messages that appear before the actual commands and parameters in the log file.
You can specify the number of lines for the output display.
For multi-column output, you can specify which columns to display.
In addition to plain-text output, for some commands you can specify HTML output.
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.
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.
You can specify parameter values at several points in a CLI session:
CLI startup – You can specify parameters on the UNIX command line when you start the CLI. Parameters that are specified at startup are global to the session. Global parameters retain their values unless overridden with the set command or removed from the current session with the unset command.
CLI commands – You can specify parameters for individual CLI commands executed during a session. A value specified as part of a command temporarily overrides the value of a global parameter for the duration of that command.
Input file – Parameter definitions can be stored in an external file and can be invoked at any time in a CLI session. Parameter values that are defined in an external file are overridden by global parameters and by individual command parameters.
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"
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"
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.
This section describes parameters that have predefined meanings within the CLI.
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.
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.
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.
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.
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]+.
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.
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" |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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.
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.
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.
See CLI Command and Parameter Overview for an overview of command types and concepts.
The following list describes the basic CLI commands.
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 |
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.
The exit command disconnects from the server and terminates the CLI session.
There is no difference between the exit and the quit commands.
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] |
The kill command terminates any commands that are running in the background.
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.
The logout command terminates your connection to the Sun Management Center server, but does not terminate the CLI session.
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.
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.
The print command is not saved in the command history.
The quit command disconnects from the server and terminates the CLI session.
There is no difference between the quit and the exit commands.
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.
The reset command is not saved in the command history.
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 |
The status command displays the status of any commands that are running in the background.
The unalias command removes the alias that was specified as an argument.
The unset command removes the specified parameters from the current session.
The unset command is not saved in the command history.
Several types of extended commands that are available in the CLI are described in these sections:
Topology import and export commands described in Import and Export CLI Interface
There are seven extended commands for managing modules. For details about the a, m, f, and columns parameters, refer to Predefined Parameters and Flags.
Disable a module or modules in an agent or agents. The disableModule command takes the following parameters: a and m
Enable a module or modules in an agent or agents. The enableModule command takes the following parameters: a, f, m, and columns.
Get a list of loaded modules in an agent or agents. The getLoadedModules command takes the following parameters: a, f, and columns.
Get information for a particular module. The getModule command takes the following parameters: a, f, m, and columns.
Get a list of modules in an agent. The getModules command takes the following parameters: a, f, and columns.
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.
Unload one or more modules in an agent or agents. The unloadModule command takes the following parameters: a, f, m, and columns.
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 |
There are four extended commands for managing object attributes and attribute values.
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.
The value of the mgtObj parameter is the name of the managed object whose attributes and properties are being set or retrieved.
The value of the property parameter is the name of the property whose attributes and values are being set or retrieved.
The value of the propInst parameter is the name of the instance of the property whose attributes and values are being set or retrieved.
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.
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.
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.
You can set and retrieve object attributes and attribute values with the following commands:
The addRow command adds a row to a table. The addRow command takes the following parameters: a, m, mgtObj, property, propInst, and rowValues.
The delRow command deletes a row from a table. The delRow command takes the following parameters: a, m, mgtObj, property, propInst, and rowValues.
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.
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.
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" |
There are five extended commands for managing alarms.
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.
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).
The value of the command parameter is the alarm action to be performed.
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.
The value of the managed_object parameter is the name of the managed object for which alarms are to be managed.
The value of the note parameter is a text annotation for the command being run.
The value of the property parameter is the name of the property for which alarms are to be managed.
The value of the property_instance parameter is the name of the specific property instance for which alarms are to be managed.
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.
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
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).
You can examine alarm values and set alarm actions with the following commands:
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).
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).
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.
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
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.
The following command retrieves all alarms with severity of ERR or DWN from the host haiku:
> getAlarms a=haiku severity=ERR,DWN |
There are nine extended commands for managing topology.
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.
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.
The value of the arch parameter is the architecture of the topology object.
The value of the domain parameter is the name of the Sun Management Center domain that you must specify for the setCurrentDomain command.
The value of the family parameter is the object family of the topology object.
The value of the fullDesc parameter is a text description of the entity or group being created.
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).
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
The value of the readInfo parameter is the name of the SNMPv1 read community for SNMP polled objects.
The value of the targetHost parameter is the name of the target host.
The value of the targetIP parameter is the IP address of the target host.
The value of the topoCfg parameter is configuration information for the topological representation of a managed entity.
The value of the topoType parameter is the topological representation type of a managed entity.
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
The value of the writeInfo parameter is the name of the SNMPv1 write community for SNMP polled objects.
There are nine extended commands for managing topology.
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.
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.
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.
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.
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.
The getCurrentDomain command returns the name of the current domain.
The getDomains command returns a list of all managed domains.
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.
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.
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 |
The CLI provides the following output options:
Log command execution to a file
Log command output to a file
Control appearance of command output on the screen
Specify output as plain text or HTML
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.
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:
Plain text
HTML
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.
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 ================================================================ |
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
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
This section describes some common CLI procedures.
To begin an interactive session, type the command /opt/SUNWsymon/sbin/es-cli followed by any desired global parameters.
Type login in response to the CLI prompt (>).
Type the name of the host to which you wish to connect in response to the Host prompt.
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. > |
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.
After you have installed the Sun Management Center console layer, double-click es-cli in the CLI folder.
The CLI screen is displayed.
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 obtain a list of all available CLI commands, type help at the CLI prompt.
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 |
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 |
To enable output to be viewed one page at a time, set the more parameter to on.
> set more=on |
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.
To stop recording, unset the log parameter.
> unset log |
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 |