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.