A P P E N D I X  F

Platform Commands

The platform command reports or changes some aspect of the state of the platform.

TABLE F-1 lists the groups of platform subcommands.


TABLE F-1 Platform Subcommand Groups

Subcommand Group

Description

platform console

Manages access to the platform serial console.

platform os state

Manages the current state of the operating system (OS).

platform power state

Manages the state of the platform power.

platform get hostname

Displays the host name of the current primary platform.

platform get product id

Displays the product ID for the current system.




Note - Every command returns a return code upon completion.




Platform Console Subcommands

The subcommands listed in TABLE F-2 allow you to manage access to the platform serial console.


TABLE F-2 Platform Console Subcommands

Subcommand

Description

platform console

Provides access to the platform serial console.

platform get console

Retrieves the configuration of the Service Processor (SP) access to the platform serial console.

platform set console

Configures the SP access to the platform serial console.


Platform Console Subcommand

Description: For remote-management capability, this command provides access to the platform serial console. Used in conjunction with the subcommand platform set console and the appropriate BIOS/platform OS settings, this command enables you to view the platform serial console while logged in to the SP.

Format

Command format:

platform console 

You must configure the BIOS settings using the BIOS Setup utility. To refresh the BIOS Setup screen, press Control-R. Choose the Advanced tab to set the configuration.

TABLE F-3 lists common COM1 values. TABLE F-4 lists common values for console redirection.


TABLE F-3 Common COM1 Values

I/O Device Configuration

Serial port A

Enabled

Base I/O address

3F8

Interrupt

IRQ 4


TABLE F-4 Common Values for Console Redirection

Console Redirection

Com Port Address

On-board COM A

Console connection

Direct

Baud Rate

19.2K

Flow Control

None

Console Type

ANSI


 

Note - You can change these values, as long as they are the same as serial-port values for the operating system (OS). If your operating system supports the COM2-4 values, you can set these for the BIOS settings.



The serial-console settings in the platform OS should be set to match the BIOS settings.

Enter the following while you are connected to the console:

^Ec character 

where ^E represents Control-E and character is one of the entries in TABLE F-5:


TABLE F-5 Serial-Console Values

Character

Function

.

Disconnects an attach read/write.

b

Sends a broadcast message.

c

Toggles flow control.

d

Takes down a console.

e

Changes the escape sequence.

f

Forces an attach read/write.

g

Groups information.

i

Information dump.

L

Toggles logging on/off.

l?

Breaks the sequence list.

l0

Sends a break per configuration file.

l1-9

Sends a specific break sequence.

o

Re-opens the tty and log file.

p

Replays the last 60 lines.

r

Replays the last 20 lines.

s

Spy read only.

u

Shows the host status.

v

Shows the version information.

w

Shows who is logged on to this console.

x

Shows the console baud information.

z

Suspends the connection.

<cr>

Ignores/aborts the command.

?

Prints this message.

^R

Replays the last line.

\ooo

Sends the character by octal code.


Under certain circumstances, it might be necessary to send a serial-break sequence to the platform OS (for example, to simulate the SysRq key when CONFIG_MAGIC_SYSRQ is defined and enabled in a Linux kernel).

To perform this operation, use the following sequence:

^Ecl0 

(Control-E, followed by the lowercase letter "C", the lowercase letter "L" and the digit "0".)

The platform console command responds by displaying the string [halt sent], confirming that the break sequence has been generated.

In the event that console output becomes corrupted, ^Ecd ^Eco usually restores proper operation; this problem is normally due to flow-control issues.

Example

The following example lists the steps you would perform to enable and run the platform console:

1. Check or set the BIOS settings.

2. Run the command:

platform set console -s sp -S 19200 -e 

3. Run the command:

platform set console 

Return Codes

TABLE F-6 lists the return codes for this subcommand.


TABLE F-6 Return Codes for Subcommand platform console

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.


Platform Get Console Subcommand

Description: Retrieves the configuration information regarding the Service Processor (SP) access to the platform serial console.

Format

Command format:

platform get console [{-H|--noheader}] [{-D | --delim <DELIMITER>}] 

TABLE F-7 lists the arguments for this subcommand.


TABLE F-7 Arguments for Subcommand platform get console

Arguments

Description

{-H |--noheader}

Suppresses column headers.

{ -D | --delim }

Delimits columns with the specified delimiter. Headings are also delimited unless suppressed. The delimiter can be any character or string.


The following output displays when successful:

Rear Panel 	Enabled Speed			 	Pruning 			Log Trigger 
SP Console	Yes		115200		No			1024KB 

or

Platform COMA	No		19200		Yes			64KB 	

One of the other lines of data displays, depending on whether the rear-panel serial port is connected to the platform or to the SP. See TABLE F-8.


TABLE F-8 Supplementary Output

Column

Description

Enabled

Displays No if the external serial port is connected to the platform. Otherwise, the external serial port is connected to the SP console; you can access the platform serial console through the SP command line by running the subcommand platform console.

Speed

Indicates the communications speed of the link.

Prune

Indicates whether ANSI escape code and duplicate information pruning is enabled.

Log Trigger

Indicates the approximate size at which log rotation occurs (for example, when the file console.0 is removed, the current log is moved to console.0 and a new log file is opened).

Pruning of log-file contents happens only when rotation occurs. The minimum size for a log file is 64KB; the maximum size is 1024KB.


Return Codes

TABLE F-9 lists the return codes for this subcommand.


TABLE F-9 Return Codes for Subcommand platform get console

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.


Platform Set Console

Description: Enables the configuration of SP access to the platform serial console, sets the speed of the connection and limits the size of the log files created.

Format

Command format:

platform set console {--serial|-s} platform 

This option configures the external serial port so that it is connected to the platform serial console. This is the default setting.

platform set console {--serial|-s} sp 
[{{--enable|-e}|{--disable|-d}}] 
[{{--prune|-p}|{--noprune|-n}}] [{--speed|-S} 
{1200|2400|4800|9600|19200|38400|115200}] [{--log|-l} size] 

This option configures the external serial port so that it is connected to the SP serial console. You can then access the platform serial console through the SP command line by running the subcommand platform console.

TABLE F-10 lists the arguments for this subcommand.



Note - If -s is set to platform, none of the following arguments can be used.




TABLE F-10 Arguments for Subcommand platform set console

Arguments

Description

{-S | --speed} {1200|
2400|4800|9600|19200|
38400|115200}

Select the port speed for the platform console. BIOS, the platform OS and the console must all be configured for the same speed.

{-d | --disable}

Indicates that the platform console monitor is inactive. Cannot be used with: -e.

{-e | --enable}

Indicates that the platform console monitor is active. Cannot be used with: -d.

{-l | --log} size

Select the trigger size in KB for console log rotation.

The acceptable values for log size are between 64 and 1024 inclusive.

{-n | --noprune}

Indicates that the platform console log should be the raw console data. Cannot be used with: -p.

{-p | --prune}

Indicates that the platform console log is to be cleaned of ANSI sequences and pruned of duplicated information. Cannot be used with: -n.

{-s | --serial} {sp|platform}

Specify whether the serial port is connected to the platform COMA port, or the SP serial console.

Cannot be used with: -e [platform] -d [platform]
-p [platform] -n [platform] -S [platform] -l [platform].


Return Codes

TABLE F-11 lists the return codes for this subcommand.


TABLE F-11 Return Codes for Subcommand platform set console

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_InvalidArgument

4

One or more arguments were incorrect or invalid.

NWSE_NoPermission

6

Not authorized to perform this operation.

NWSE_NoMemory

8

Insufficient memory.

NWSE_DeviceError

25

Unable to read or write to the device.



Platform OS State Subcommands

The subcommands listed in TABLE F-12 allow you to manage the operating system (OS).


TABLE F-12 Platform OS State Subcommands

Subcommand

Description

platform get os state

Retrieves the current state of the platform OS (for example, running, booting, off and so on).

platform set os state

Reboots the platform into the default OS, BIOS setup or BIOS update, or shuts down the platform.

platform set os state boot

Serves as an alias for the subcommand platform set os state reboot and only functions when the platform power state is off.


The subcommand platform set os state reboot causes the platform to turn on and boot the OS if the platform is off, but reboots the OS if the platform is on.

The subcommand platform set os state waits for the platform to boot; the subcommand platform set power state only waits for the power to come on.

Platform Get OS State Subcommand

Description: Retrieves the current state of the platform OS.

Format

Command format:

platform get os state 

The values for the current state include:

When the platform is in the Communicating state (in which the OS is communicating with the SP), if the platform drivers are uninstalled, the SP remains in the Communicating state even though it can no longer communicate with the platform.

Refer to Platform Set OS State Subcommand for more information about setting the state.

Return Codes

TABLE F-13 lists the return codes for this subcommand.


TABLE F-13 Return codes for Subcommand platform get os state

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.


Platform Set OS State Subcommand

Description: Provides the ability to reboot the platform into the default OS, BIOS setup or BIOS update, or to shut down the platform. Rebooting to BIOS setup allows you to configure the BIOS parameters while BIOS update allows you to reflash the BIOS image.

Format

Command format:

platform set os state reboot [{-W | --nowait}] [{-b | --bios}] [{-f|--forced}] [-q | --quiet] 
platform set os state reboot-to-diags [{-f |--forced}] [START | STOP]
platform set os state shutdown[{-W | --nowait}] [{-f |--forced}] [-q | --quiet] 
platform set os state update-bios [-q | --quiet] [{-W | --nowait}] BIOS_IMAGE 

TABLE F-14 lists the arguments for this subcommand.


TABLE F-14 Arguments for Subcommand platform set os state

Arguments

Description

[-W | --nowait]

If specified, the subcommand returns immediately instead of waiting for the operation to complete.

{-f | --forced}

Results in a hard power off.

[-b | --bios]

Only applicable to the subcommand platform set os state reboot. Takes you to the BIOS Setup utility.

[-q | --quiet]

Suppresses interative warning messages. No error messages are blocked.

update-bios

Command option for flash updating the BIOS image.

BIOS_IMAGE

Only applicable to the subcommand set os state update-bios. Indicates the name of the file containing the new BIOS image to use when updating the BIOS.


The subcommand platform set os state waits for the platform to boot; the subcommand platform set power state only waits for the power to come on.

The subcommand platform set os state reboot causes the platform to turn on and boot the OS if the platform is off, but reboots the OS if the platform is on.

When the platform is in the Communicating state (in which the OS is communicating with the SP), if the platform drivers are uninstalled, the SP remains in the Communicating state even though it can no longer communicate with the platform.

Refer to Platform Get OS State Subcommand for a list of possible states.

Return Codes

TABLE F-15 lists the return codes for this subcommand.


TABLE F-15 Return Codes for Subcommand platform set os state

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.

NWSE_Busy

9

Device or resource is busy.

NWSE_FileError

18

File open, file missing, or a read or write error occurred.

NWSE_InvalidOpForState

22

Invalid operation for current state.


Platform Set OS State Boot Subcommand

Description: This command serves as an alias for the subcommand platform set os state reboot and only functions when the platform power state is off.

Format

Command format:

platform set os state boot [{-f |--forced}] {[-b | --bios]} [-q | --quiet] [-W | --nowait] 

TABLE F-16 lists the arguments for this subcommand.


TABLE F-16 Arguments for Subcommand platform set os state boot

Arguments

Description

{-f | --forced}

Results in a hard power off. This option is ignored.

[-b | --bios]

Allows you to reflash the BIOS image.

[-q | --quiet]

Suppresses interative warning messages. No error messages are blocked.

[-W | --nowait]

If specified, the command returns immediately instead of waiting for the operation to complete.


Return Codes

TABLE F-17 lists the return codes for this subcommand.


TABLE F-17 Return Codes for Subcommand platform set os state boot

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.

NWSE_Busy

9

Device or resource is busy.

NWSE_InvalidOpForState

22

Invalid operation for current state.



Platform Power State Subcommands

The subcommands listed in TABLE F-18 allow you to manage the platform power.


TABLE F-18 Platform Power State Subcommands

Subcommand

Description

platform get power state

Provides the ability to determine the platform power state (for example, whether it is on or off).

platform set power state

Provides the ability to turn the platform power on or off.


The subcommand platform set power state does not affect the platform if the platform is already on; if the platform is off, it powers on and boots the OS. In other words, the subcommand platform set power state ensures that the platform is on, but does not reboot it if it is not on.

The subcommand platform set os state waits for the platform to boot; the subcommand platform set power state only waits for the power to come on.

Platform Get Power State Subcommand

Description: Provides the ability to determine the platform power state from within a script (whether the platform is on or off).

Format

Command format:

platform get power state 

Return Codes

TABLE F-19 lists the return codes for this subcommand.


TABLE F-19 Return codes for Subcommand platform get power state

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.


Platform Set Power State Subcommand

Description: Provides the ability to turn the platform power on or off from within a script. However, there are equivalent, less-destructive commands available. This command does not notify the platform OS of the request through the supplied channels.

Format

Command format:

platform set power state [{-W|--nowait}] [{-f|--forced}] [{-t|--timeout} TIME] {off|on|cycle} 

TABLE F-20 lists the arguments for this subcommand.


TABLE F-20 Arguments for Subcommand platform set power state

Arguments

Description

{-W |--nowait}

If specified, the command returns immediately instead of waiting for the operation to complete.

{-f | --forced}

Results in a hard power off.

{-t |--timeout}

Specifies the maximum time to wait for the operation to complete (in seconds).

{off | on | cycle}

Specifies whether to turn the platform power on or off or to cycle. Specifying the cycle argument causes platform power to be turned off, then on.


The subcommand platform set power state does not affect the platform if the platform is already on; if the platform is off, it powers on and boots the OS. In other words, the subcommand platform set power state ensures that the platform is on, but does not reboot it if it is not on.

The subcommand platform set os state waits for the platform to boot; the subcommand platform set power state only waits for the power to come on.

Return Codes

TABLE F-21 lists the return codes for this subcommand.


TABLE F-21 Return Codes for Subcommand platform set power state

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_RPCTimeout

2

Request was issued, but was not serviced by the server. RPC procedure timed out and the request may or may not have been serviced by the server.

NWSE_RPCNotConnected

3

Unable to connect to the RPC server.

NWSE_NoPermission

6

Not authorized to perform this operation.

NWSE_MissingArgument

7

Missing argument(s).

NWSE_TimedOut

23

Operation timed out.



Platform Get Hostname Subcommand

Description: Displays the host name of the current primary platform. The data is refreshed only when the platform is rebooted.

Format

Command format:

platform get hostname [{-H|--noheader}] 

TABLE F-22 lists the argument for this subcommand.


TABLE F-22 Argument for Subcommand platform get hostname

Arguments

Description

{-H | --noheader}

Suppresses column headers.


Return Codes

TABLE F-23 lists the return codes for this subcommand.


TABLE F-23 Return Codes for Subcommand platform get hostname

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_NoMemory

8

Insufficient memory.

NWSE_Busy

9

Device or resource is busy.

NWSE_RPCConnected

11

RPC client already connected.

NWSE_RPCConnRefused

12

RPC connection refused.

NWSE_NoRouteToHost

13

No route to host (network down).

NWSE_HostDown

14

Host is down.



Platform Get Product ID Subcommand

Description: Displays the product ID for the current system.

Format

Command format:

platform get product-id 


Note - You can also retrieve the product ID, board revision number and PRS revision number by running the subcommands sensor get and inventory get hardware.



Return Codes

TABLE F-24 lists the return codes for this subcommand.


TABLE F-24 Return Codes for Subcommand platform get product-id

Return Code

ID

Description

NWSE_Success

0

Command successfully completed.

NWSE_InvalidUsage

1

Invalid usage: bad parameter usage, conflicting options specified.

NWSE_NotFound

5

Entity (user, service, file, path or other) was not found.

NWSE_FileError

18

File open, file missing, or a read or write error occurred.

NWSE_ServiceNotAvailable

24

Requested service is not available.