Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Wednesday, March 11, 2009

Sun Remote System Control - Using the RSC Command Shell

Using the RSC Command Shell

The RSC command shell is a simple command-line interface that supports commands that allow you to administer or diagnose the server. It also has commands for configuring RSC.

RSC supports a total of four concurrent telnet sessions per server, including command-line interface sessions and a graphical user interface (GUI) connection to the server console (Open Console). In addition, RSC supports up to four active concurrent RSC GUI sessions.



Note - Sun Enterprise 250 servers support two concurrent telnet sessions and three active concurrent RSC GUI sessions.



After you log in to your RSC account, the RSC shell prompt appears (rsc>), and you can enter RSC shell commands. This chapter tells you how to log in to your RSC account and describes RSC command use and syntax.

The following table summarizes RSC shell commands. Each command is explained in greater detail in the following sections.


TABLE 4-1 RSC Shell Commands

Name

Description

environment

Displays current environmental information

showenvironment

Same as environment

shownetwork

Displays the current network configuration

console

Connects you to the server console

break

Puts the server in debug mode

xir

Generates an externally initiated soft reset to the server

bootmode

Controls server firmware behavior, if followed by a server reset within 10 minutes (similar to L1-key combinations on non-USB Sun keyboards)

reset

Resets the server immediately

poweroff

Powers off the server

poweron

Powers on the server

loghistory

Displays the history of all events logged in the RSC event buffer

consolehistory

Displays the history of all console messages logged in the buffer

consolerestart

Makes the current boot and run console logs "original"

set

Sets a configuration variable

show

Displays one or more configuration variables

date

Displays or sets the current time and date

showdate

Same as date command without arguments

setdate

Same as date command with arguments

password

Changes your RSC password

useradd

Adds an RSC user account

userdel

Deletes an RSC user account

usershow

Shows characteristics of an RSC user account

userpassword

Sets or changes a user's password

userperm

Sets the authorization for a user

resetrsc

Resets RSC immediately

help

Displays a list of RSC shell commands and a brief description of each

version

Displays version number for RSC firmware and components

showsc

Same as version without the -v option

flashftp

Updates the RSC Flash ROM image

display-fru

Displays information stored in the RSC serial EEPROM

logout

Ends your current RSC shell session

setlocator

Turn the system locator LED on or off (Sun Fire V480 servers only).

showlocator

Show the state of the system locator LED (Sun Fire V480 servers only).




Note - For Sun Enterprise 250 servers, the following shell command aliases are not available: showenvironment, showdate, setdate, and showsc.



More detailed descriptions of the commands are provided in the following sections.



Note - Some commands require a specific user permission level. See userperm username [a][u][c][r] for information about user permission levels.




Logging In to Your RSC Account

After RSC software is installed and configured and an account has been set up for you, you can connect to RSC and log in to your account using a Solaris workstation, Microsoft Windows PC, standard ASCII character terminal, or a computer running ASCII terminal emulation software.

Follow these steps to log in to your RSC account:

1. Connect to RSC using one of these methods:

a. Use point-to-point protocol (PPP) to connect to your company Ethernet, and then use the telnet command to connect to RSC.

Ask your network administrator if you do not know the server's RSC name (Sun recommends the name servername-rsc). Note that, unlike the graphical user interface, the command-line interface does not attempt to connect to RSC by appending -rsc to the name you enter if that name fails.

b. If you are already connected to your company Ethernet, use the telnet command to connect to RSC.

c. Use PPP to connect to the RSC modem. To use this option, PPP must be enabled.

d. If PPP is not enabled, dial in to the RSC modem.

When connection is established, the following screen appears:


RSC software version 2.0.0 (server-name)
Please login:
Please enter password:

e. If your server has an RSC serial port, connect an ASCII terminal directly to the RSC serial port.



Note - To use this method on Sun Enterprise 250 servers, you must disable PPP by using the RSC shell, RSC GUI, or the rscadmutility to set the ppp_enabledconfiguration variable to false.



2. When connection is established, type your RSC login name.

3. Type your RSC password.

Your password is not echoed on the screen. After you correctly enter your password, RSC displays this command prompt:


rsc>

You can enter RSC shell commands at the rsc> prompt.

Logins are recorded in the RSC event log. In addition, RSC sends an alert if it detects more than five login failures within five minutes. Except for Sun Enterprise 250 servers, RSC automatically disconnects a session after 10 minutes of user inactivity.



Note - For Sun Enterprise 250 servers, you can set RSC to disconnect a session connected to the serial port after 10minutes of inactivity.




Server Status and Control Commands

The following RSC commands show server status or control server operation:

  • environment (or showenvironment)
  • shownetwork
  • console
  • break
  • xir
  • bootmode
  • reset
  • poweroff
  • poweron
  • setlocator
  • showlocator

environment

Use the environment command to display a snapshot of server environmental status, such as temperatures, power supply status, front panel LED status, keyswitch position, and so forth. You can also use the command abbreviation env. The display uses similar format to that used for the UNIX command prtdiag(1m).

For example:


rsc> environment

=============== Environmental Status ===============

System Temperatures (Celsius):
------------------------------
      CPU0    60
      CPU1    57
       RSC    30

=================================

RSC Power Status:
-----------------

RSC is running on Normal System Power

RSC Battery Voltage: 4.18V

=================================

Front Status Panel:
-------------------

Keyswitch position is in On mode.

=================================

System LED Status: GENERAL ERROR    POWER 
                      [OFF]         [ ON]     

Disk LED Status:    OK = GREEN  ERROR = YELLOW
        DISK  1:    [OK]
        DISK  0:    [OK]
=================================

Fan Bank:
---------

Bank      Speed     Status
         (0-255)   
----      -----     ------
 SYS       151        OK

=================================

Power Supplies:
---------------

Supply     Status
------     ------
  1          OK: 560w

=================================

rsc>

The display differs according to the server model and configuration. Note that some environmental information may be unavailable when the server is in Standby mode.

showenvironment


The shownenvironmentcommand is the same as the environmentcommand. (Not available for Sun Enterprise 250 servers.)

shownetwork

The shownetwork command displays the current network configuration.
For example:


rsc> shownetwork
RSC network configuration is:
DHCP server: 129.149.2.3
IP Address: 129.149.2.6
Gateway Address: 129.149.2.7, 129.149.2.8
Netmask: 255.255.255.0
Ethernet Address: ae:30:30:00:00:01
rsc>

console

Use the console command to enter RSC console mode and connect to the server console from the RSC shell. When you use this command, the system displays a standard Solaris login prompt. If RSC is not designated as the server console, nothing is displayed.

You must have C level user permission to use this command. An escape character sequence is used to return to the RSC prompt. The default escape sequence is ~. (tilde period). See escape_char.

break

Use the break command to put the server into Debug mode. You must have C level user permission to use this command. The server front panel keyswitch must not be in the Lock position, and RSC must be designated as the console (see Chapter 6). Debug mode can use either kadb or OpenBoot PROM, depending on server configuration.

xir

This command generates the equivalent of an externally initiated reset (XIR) of the server. You must have R level user permission to use this command. The server enters OpenBoot PROM mode and displays the ok prompt. This command is useful for driver or kernel debugging, as most of the contents of the server's memory and registers is preserved. To resume operation of the system after using the xir command, you must reboot the server.

bootmode [-u] [normal|forth|reset_nvram|diag|
skip_diag]

This command provides control over the server firmware behavior after a server reset. Functionality of this command is identical to that available on non-USB Sun keyboards using L1 key combinations. You must have R level user permission to use this command. If you use the bootmode command without arguments, RSC displays the current boot mode.

The bootmode setting overrides the server's OpenBoot Diagnostics diag-switch? setting immediately after the next reset only. If RSC does not detect a server reset within 10 minutes, the bootmode command is ignored. For example:


rsc> bootmode forth
rsc> reset

To set the diag or skip_diag option, you must follow the bootmode command with the poweroff and poweron commands within 10 minutes. For example:


rsc> bootmode skip_diag
rsc> poweroff
rsc> poweron

To force console input and output to RSC, use the -u option before specifying the boot mode. This is the equivalent of using the OpenBoot PROM commands shown in Redirecting the Console to RSC, but affects the next boot only.

The following table describes modes you can specify using the bootmode command.


TABLE 4-2 Modes Used With the bootmode Command

Mode

Description

-u

Force the server to direct the console to RSC; the -u option must precede any boot mode you specify; requires server reset

normal

Normal boot; server runs low-level diagnostics; requires server reset

forth

Enter Forth interpreter as soon as possible (equivalent to L1-F on non-USB keyboards); requires server reset

reset_nvram

Reset all NVRAM variables to default values (equivalent to L1-N on non-USB keyboards); requires server reset

diag

Force the server to run full diagnostics (equivalent to L1-D on non-USB keyboards); requires server power-off and power-on

skip_diag

Force the server to skip diagnostics (equivalent to L1-S on non-USB keyboards); requires server power-off and power-on




Note - The diag and skip_diag modes take effect only if you follow the bootmode command with the poweroff and poweron commands within 10 minutes.



reset

This command forcibly resets the server immediately. You must have R level user permission to use this command. The server reboots according to the server's designated boot mode. The reset command does not perform a clean shutdown of the system, and data may be lost. When possible, use the corresponding Solaris administration command instead.



Note - The default configuration of Sun workgroup server firmware does not invoke POST when the server resets. However, you can change this behavior through NVRAM variable settings; for additional details, see the Platform Notes for your server.



poweroff

Use the poweroff command to power off the server. You must have R level user permission to use this command. This command has no effect if the server is already powered off. RSC remains available since it uses the server's standby power. Note, however, that some environmental information may be unavailable when the server is in Standby mode.

The poweroff command attempts to perform a clean shutdown of the system. However, when possible, use the corresponding Solaris administration command instead.

It can take up to 35 seconds for the poweroff command to completely shut down the system (except on Sun Enterprise 250 servers). This is because RSC waits for a clean shutdown to complete before poweroff can occur.



Note - For Sun Enterprise 250 servers, the poweroffcommand does not perform a clean shutdown of the system.



poweron

Use the poweron command to power on the server. You must have R level user permission to use this command. This command has no effect if the server's keyswitch is in the Standby position, or the server is already powered on.

setlocator

Use the setlocator command to turn the system locator LED on or off. This command applies to Sun Fire V480 servers only. For more information on this command, refer to Controlling the Locator LED.

For more information on the locator LED, refer to the Sun Fire V480 Administrator's Guide.

showlocator

Use the showlocator command to view the state of the system locator LED (on or off). This command applies to Sun Fire V480 servers only. For more information on this command, refer to Controlling the Locator LED.

For more information on the locator LED, refer to the Sun Fire V480 Administrator's Guide.


RSC View Log Commands

Use the following RSC commands to work with RSC and console log files:

  • loghistory (or lhist)
  • consolehistory (or chist)
  • consolerestart

loghistory [index [+|-]n] [pause n]

Use the loghistory command without subcommands to display the history of all events logged in the RSC event buffer. These events include server reset events and all RSC commands that change the state of the system. You can also use the command abbreviation lhist.

Use the following subcommands to control loghistory display.

index [+|-]n

Use the index subcommand to designate a buffer position at which to begin the display, as follows:

  • index +n to designate a line number relative to the beginning of the buffer
  • index -n to designate a line number relative to the end of the buffer
  • index n to designate a line number relative to the beginning of the buffer (same as index +n)

The origin of counting is 1; that is, index +1 indicates the first line in the buffer, index -1 indicates the last. For example:


rsc> loghistory index -30

This command prints the last 30 lines and any additional lines that were appended to the buffer between the time that the command began execution and the time that it terminated.

pause n

Use the pause subcommand to display n lines of the log at a time (similar to the more command). The value of n must be a decimal integer. The default is to display the entire RSC log without pausing.

Each event recorded in the log has the following format:


$TIME $HOSTNAME $EVENTID $message

EVENTID is a unique identifier for the event, TIME is the time the event occurred (as measured by RSC time), and message is a user-friendly description of the event.

The following is an example event log entry:


FRI JAN 01 07:33:03 2001 sst4828: 00060003: "RSC System reset"

consolehistory [boot|run|oboot|orun]
[index [+|-]
n] [pause n]

Use the consolehistory command to display console messages logged in RSC buffers. With no arguments, this command prints the entire contents of all non-empty console buffers. You can use the command abbreviation chist.

There are four console logs:

  • The boot buffer contains POST, OpenBoot PROM, and UNIX boot messages received from the server for the most recent boot.
  • The run buffer contains the most recent data received from the server operating system.
  • The oboot buffer contains POST, OpenBoot PROM, and UNIX boot messages for the first power-on boot, the original boot.
  • The orun buffer contains the data received from the server's operating system after the first reboot that follows a power-on boot (the original boot).

Each buffer can contain up to 64Kbytes of information. (On Sun Enterprise 250 servers, the original boot log and boot log buffers can contain up to 16 Kbytes of information.)

When the first power-on boot begins, RSC fills the original boot (oboot) buffer with data from the server's console. After that buffer fills up, it writes data to the original run (orun) log. When the orun log fills up, it overwrites old data in the orun log.

When RSC senses a server reset while writing the orun log, it switches to the boot log. After that fills up, it switches to the run log. When the run log fills up, it overwrites old data in the run log.

When RSC senses a server reset while writing the current run log, it switches to the current boot log again.

pause n

Use the pause subcommand to display n lines of the log at a time (similar to the more command). The value of n must be a decimal integer. The default is to display 10 lines of the log at a time.

See loghistory [index [+|-]n] [pause n] for a description of the index subcommand.



Note - Time stamps recorded in console logs reflect server time. These time stamps may be offset from RSC time stamps recorded in the RSC event log. To synchronize RSC time with server time, use the rscadm command rscadm date -s, reset the server, or run the script /usr/platform/platform-name/rsc/rsc-initscript. You can obtain the string to use for platform-name using the Solaris command
uname -i.



consolerestart

Use the consolerestart command to make the current boot and run logs the original logs (designated oboot and orun). This command copies the current boot and run buffers to the oboot and orun buffers, overwriting the previous contents. Next, it clears the current boot and run buffers, and begins logging to the old run log. You must have A level user permission to use this command.

For example, after adding a hardware component to the server, reboot the server and use the consolerestart command so that the new component will appear in the original console logs.


RSC Configuration Commands

Use the following RSC commands to set or show characteristics of the RSC or server configuration:

  • set
  • show
  • date (also showdate and setdate)
  • password
  • useradd
  • userdel
  • usershow
  • userpassword
  • userperm
  • resetrsc

set variable value

Use the set command to set an RSC configuration variable. You must have A level user permission to use this command. See RSC Configuration Variables for descriptions of these variables.

Changes to some variables do not take effect until the you reset RSC using the command-line interface (CLI) resetrsc command, or the rscadm subcommand rscadm resetrsc, or by using the graphical user interface.

You can use the null string ("") to set a variable to null. To set a variable to a string that includes spaces, enclose the string in double quotes. For example:


rsc> set page_info2 ""
rsc> set page_init1 "&F &E0"

show [variable]

Use the show command to display the value of RSC configuration variables. You can specify one variable only; if you do not specify a variable, RSC displays all configuration variables. See RSC Configuration Variables for descriptions of these variables.

date [[mmdd]HHMM|mmddHHMM[cc]yy][.SS]

Use the date command without arguments to show RSC's current date and time. If you have A level user permission, you can use the date command to set the current date and time. The following table describes components of the date format.


TABLE 4-3 Components of the date Command

Option

Description

mm

Month number

dd

Day-of-the-month number

HH

Hour number (24-hour system)

MM

Minute number

.SS

Second number

cc

First two digits of year

yy

Last two digits of year


You may omit the month, day, and year; the current values are applied as defaults.

Examples:


rsc> date 091521452000
Fri Sep 15 21:45:00 EDT 2000
rsc> date 09152145
Fri Sep 15 21:45:00 EDT 2000
rsc> date 2145
Fri Sep 15 21:45:00 EDT 2000

The first example sets the time to September 15, 9:45 p.m., 2000. The second example sets the time to September 15, 9:45 p.m. of the current year. The third example sets the time to 9:45 p.m. of the current month, day, and year.



Note - Whenever the server boots, it sets the RSC current date and time. In addition, the RSC hardware includes a battery backed-up time-of-day chip for maintaining RSC time in between server reboots. However, to keep RSC time in sync with server time, you should periodically run the script /usr/platform/platform-name/rsc/rsc-initscript. You can obtain the string to use for platform-name using the Solaris command uname -i. If you like, you can run this script at a specified interval using the cron utility. You can also use the rscadm command rscadm date -s.



showdate


Same as the datecommand without arguments. (Not available for Sun Enterprise 250 servers.)

setdate


Same as the datecommand with arguments. You need to have Alevel user permission to use the setdatecommand to set the RSC current date and time.
(Not available for Sun Enterprise 250 servers.)

password

Use the password command to change the RSC password for the account to which you are logged in. This command behaves similarly to the UNIX passwd(1) command.

When used to change a password, RSC prompts for your current password, and if you enter it correctly, it prompts for the new password. RSC prompts again for the new password and updates it if entered identically both times. For example:


rsc> password
password: Changing password for username
Enter login password: ******
Enter new password: ******
Re-enter new password: ******
rsc>

Passwords have the following restrictions:

  • They must contain at least six characters (only the first eight characters are significant).
  • They must contain at least two alphabetic characters and at least one numeric or special character; alphabetic characters can be both uppercase and lowercase.
  • They must differ from the user's login name and any reverse or circular shift of that login name; for comparison purposes, uppercase and lowercase letters are equivalent.
  • The new password must differ from the old by at least three characters; for comparison purposes, uppercase and lowercase letters are equivalent.

useradd username


Use the useraddusernamecommand to add an RSC user account. You must have Ulevel user permission to use this command. The maximum number of RSC user accounts is 16, except on Sun Enterprise 250 servers, where the maximum number is 4. Valid characters for usernameinclude:

  • Alphabetic characters
  • Numeric characters
  • Period (.)
  • Underscore (_)
  • Hyphen (-)

The usernamefield has a maximum length of 16 characters (eight characters for Sun Enterprise 250 servers), must contain at least one lowercase alphabetic character, and the first character must be alphabetic. If these restrictions are not met, the system issues a warning and the command fails.

userdel username

This command deletes an RSC user account. You must have U level user permission to use this command.

usershow [username]


This command shows RSC user accounts; a maximum of 16 user accounts are available (4 on the Sun Enterprise 250 servers). You must have Ulevel user permission to use this command. If no argument is supplied, all accounts are shown. Information displayed includes username, permissions, and whether a password is assigned. For example:


rsc> usershow
Username Permissions Password?
setup    cuar        Assigned
msmith   c--r        None
rsc>

userpassword username

This command sets or changes the password for the specified user account. You must have U level user permission to use this command. RSC does not prompt for an existing password. See the password command for details on password format and restrictions. For example:


rsc> userpassword msmith
New password:
Re-enter new password:
rsc>

userperm username [a][u][c][r]

This command sets or changes permission levels for a specified user account.

All RSC users can look at RSC information. The following arguments increase a user's authorization level:

  • a - Administration permission; authorized to change the state of RSC configuration variables
  • u - User administration permission; authorized to use commands that add and delete users, change user permissions, and change the authorization level of other users
  • c - Console permission; authorized to connect to the server console
  • r - Reset/power permission; authorized to reset, power on, and power off the server, and reboot RSC

You must have U level user permission to use this command. You can specify zero through four authorizations. The default authorization level for a new RSC account is none of the above (that is, read-only).

If you do not specify authorization levels, RSC sets the permissions for username to read-only. However, the default user permission for the account you create during the installation procedure is cuar (full authorization).

A user with read-only permission can only use the following commands:

  • help
  • password

  • date(without arguments) and showdate(The showdatecommand is not available on Sun Enterprise 250 servers.)
  • shownetwork

  • environmentand showenvironment(The showenvironmentcommand is not available on Sun Enterprise 250 servers.)
  • loghistory
  • consolehistory
  • show

  • versionand showsc(The showsccommand is not available on Sun Enterprise 250 servers.)
  • logout
  • showlocator (Sun Fire V480 servers only)

resetrsc

The resetrsc command performs a hard reset of RSC. This terminates all current RSC sessions. You must have A level user permission to use this command. You can also reset RSC by using the rscadm resetrsc command.



Note - When you reset RSC on a Sun Enterprise 250 server without also resetting the server, RSC time defaults to 1/1/70. To synchronize RSC time with server time, reset the server, use the rscadmcommand rscadm date -sor run the script /usr/platform/platform-name/rsc/rsc-initscript. You can obtain the string to use for platform-nameusing the Solaris command uname -i.




Other RSC Commands

help

The help command displays a list of all RSC shell commands and a brief description of each.

version [-v]

The version command displays the firmware version running on RSC. Use the -v option to display more verbose information. For example:


rsc> version
RSC Version: 2.2
RSC Bootmon version: 2.0.0
RSC Firmware version: 2.2.0
rsc> version -v
RSC Version: 2.2
RSC Bootmon version: 2.0.0
RSC bootmon checksum: 4D018EBD

RSC Firmware version: 2.2.0
RSC Build Release: 20
RSC firmware checksum: 595254B1

RSC firmware built Aug 13 2001, 14:45:17

RSC System Memory Size: 8 MB

RSC NVRAM Version = 4
RSC hardware type: 3

rsc>

showsc


Same as the versioncommand without the -voption. (Not available for Sun Enterprise 250 servers.)

logout

The logout command ends your RSC session and closes your RSC connection.

flashupdate ip_address image

The flashupdate command updates the RSC Flash ROM image at the IP address you specify, with the image you specify.

showfru

The showfru command displays information stored in the RSC serial EEPROM.


No comments:

Labels

Blog Archive

BlogCatalog