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 |