|
This section lists the commands that you use to monitor and control the CLI session. It also includes the ping command, which may be used with the set and show commands described in the first two chapters of this book to monitor and control the LightStream 2020 (LS2020) node from the CLI.
Note Do not leave the CLI running idle. You should exit the CLI when you have finished using it,
or when you anticipate an extended period of inactivity in the CLI session.
Like any complex computer program, the CLI consumes some network processor (NP) or network
management system (NMS) resources even when running idle. Exiting the CLI when you have
finished will help optimize NP and NMS performance.
The CLI control commands are as follows:
clear | |
exit | |
help | |
password | |
ping | Send ICMP echo packets to a host and report on any returned packets. |
protected | |
quit | |
shell | |
source |
Use the clear command to clear the screen.
Use the exit command to protected mode or the CLI program.
In normal mode, the exit command halts the CLI program and returns you to the bash prompt. If you are in protected mode, the exit command returns you to normal mode in the CLI, so that you must type exit a second time to halt the CLI.
Use the help command to provide online help for CLI commands.
The help command displays online help information about CLI commands.
Refer to the LightStream 2020 Operations Guide for a detailed description of the online help facility in the CLI.
The following example shows the display that the help command displays with protected as its argument:
Use the password command to change the password for the npadmin account, which is also the password for protected mode. Requires protected mode.
Use the password command to change the password for the npadmin account, which is also the password for accessing protected mode in the CLI:
Note There are four accounts on the NP: oper, npadmin, root, and fldsup. To change the password for any of these accounts, use the LynxOS passwd command. (Note the difference in spelling. The LynxOS passwd command is described in the Lightstream 2020 Network Operations Guide, in the chapter on the command-line interface.) There are thus two ways to change the npadmin password (which is also the password for protected mode), but only one way to change the root, oper, or fldsup password.
Note This command affects only the node on which the CLI is running when you execute it, regardless of any target set with the command set snmp hostname name.
Use the ping command to send ICMP echo packets to a host and report on any returned packets.
The ping command sends a series of ICMP echo packets at 1-second intervals to the specified IP address and reports on any returned ICMP echo-response packets. Press ^C (the control-C key) to stop the ping command and display a summary of the results.
Note Because of the load it could impose on the network, it is unwise to use ping during normal operations or from automated scripts.
Note This command affects only the node on which the CLI is running when you execute it, regardless of a target set with the command set snmp hostname name.
The following example shows four ping packets sent to the node named boston5:
The IP address 198.113.178.17 could have been used as the command argument instead of the alias boston5. The command used the default packet size of 64 bytes. The example shows the number of packets transmitted, the number received back from boston5, and the minimum, average, and maximum round-trip transmission time.
Use the protected command to allow access to protected mode.
The protected command is used to access the CLI in protected mode. When you are in protected mode, you have access to additional commands. The command prompts you for the password for protected mode. You cannot enter protected mode unless you enter the correct password. When you are operating in protected mode, the cli> prompt is preceded by an asterisk (*cli>). To terminate protected mode and return to the cli> prompt, use the exit or quit command.
To enter protected mode, enter the protected command. You are prompted for the password for the protected mode. When you enter the correct password and press [Return], you enter protected mode. In protected mode, the cli> prompt is always preceded by an asterisk, *cli>.
Use the quit command to exit protected mode or the CLI program.
The quit command halts the CLI program. If you are in protected mode, the quit command exits from protected mode, but remains in the CLI (in normal mode), so that you must type quit a second time to exit from the CLI.
Use the shell command to execute LynxOS commands under a copy of the LynxOS shell. Requires protected mode.
The shell command executes a LynxOS command as if it were being run from the bash shell. The actual LynxOS command must be surrounded by quotes. For additional information about LynxOS commands, see the Operating System Guide. If more than one command is to be executed, it is often more convenient to start a subshell with the command shell bash at the cli> prompt. If you do this, it is very important to terminate the subshell afterward with the shell built-in command exit.
Note This command affects only the node on which the CLI is running when you execute it, regardless of a target set with the command set snmp hostname name.
The following example shows use of the shell command to run a LynxOS command that displays the date and time as known to the system. Because the command is a single word, the quotation marks are optional:
The following example shows use of the ls command to display names of all files that begin with a dot (.) plus an r. Because the command contains a space, it must be entered within quotation marks:
The metacharacter ? can be used in the quoted argument string of the shell command only awkwardly. (See the following shell bash example for the preferred method.) The CLI attempts to interpret ? as a request for help, then complains about a missing final quote. Type [^P] to repaint the command and continue typing. The following example demonstrates this workaround. Two ? characters are needed to display all files that begin with a dot, because .* and .?* would include .. (the abbreviation for the parent directory).
The following example shows use of the cbufpr command to display the last lines of the mma.traplog file. The command contains spaces, so it must be enclosed in quotation marks:
Use the command bash to start a subshell. This is necessary for executing multiple commands, and it makes it easier to execute a command containing the metacharacter ? (described with an earlier example). The following example illustrates use of the cd command, then the vi editor, and finally the shell built-in command exit to return to the CLI:
The effects of the cd command are lost when you terminate the subshell. The next use of the shell command will execute LynxOS commands in the user's login directory.
Use the source command to execute CLI commands stored in a disk file, known as a CLI script.
The source command executes CLI commands that are stored in a disk file. This is referred to as a CLI script. The file does not have to be executable (it is not interpreted by the shell). Before executing each command, the CLI prints a + character as a prompt and echoes the command line as it appears in the script file.
The simplest way to create a CLI script is to use the echo command at the bash prompt as shown in the example below. You may also use the vi editor. Each command must begin on a new line. Comments may be included with the CLI commands in C programming style, between an initial /* string and a final */ string.
You may interrupt extended output of a command in the script by typing [^C]. The software drops buffered output and goes on to the next command.
Note This command affects only the node on which the CLI is running when you execute it, regardless of a target set with the command set snmp hostname name.
The following example shows how to use the echo command to create a file containing multiple commands:
The following example shows how to use the cat command to verify the contents of the new script file:
The following example shows the output that results when the example script file is executed with the source command:
Posted: Wed Jan 22 23:40:59 PST 2003
All contents are Copyright © 1992--2002 Cisco Systems, Inc. All rights reserved.
Important Notices and Privacy Statement.