Back to Contents Page

Working With CLI Command Results

Dell OpenManage™ Server Administrator Version 1.4 Command Line Interface User's Guide

  Output Options for Command Results


Server Administrator Command Line Interface (CLI) users can use command output in various ways. This section explains how to save command output to a file and how to select a format for your command results that fits different objectives.


Output Options for Command Results

CLI command output displays to standard output on your system in a command window, in an X-terminal, or on a screen, depending on your operating system type.

You can redirect command results to a file instead of displaying them to standard output. Saving command output to a file allows you to use the command output for later analysis or comparison.

Whether you display command results to standard output or have the command results written to a file, you can format the results. The format you select determines the way the command output is displayed and the way the command output is written to a file.

Controlling Command Output Display

Each operating system provides a means of controlling the way that command results display to standard output. The following is a useful command for ensuring that command results do not scroll by before you can view them. The same command syntax works for both the Microsoft® Windows® command prompt and the Red Hat Linux terminal. To display command output with control over scrolling, type the CLI command and append the pipe symbol followed by more. For example, type:

omreport system summary | more

The multiscreen system summary displays the first screen. When you want to see the next screen of command output, press the spacebar.

In the Novell® NetWare®, you can use the inetcfg command to view console messages that have scrolled past.

Writing Command Output to a File

When redirecting command results to a file, you can specify a filename (and a directory path if necessary) to which you want the command results to be written. When specifying the path to which you want your file to be written, use the appropriate syntax for your operating system.

You can save command results in two ways. You can overwrite any file that has the same name as the output file you specify, or you can keep adding results of commands to a file of the same name.

Save Command Results to a File That Can Be Overwritten

Use the -outc option when you want to overwrite data that is stored in previously written files. For example, at 11:00 A.M. you capture fan probe RPM readings for fan probe 0 on your system and write the results to a file called fans.txt. You type:

omreport chassis fans index=0 -outc fans.txt

Partial results written to the file are:

Index
Status
Probe Name
Reading
Minimum Warning Threshold
Maximum Warning Threshold
Minimum Failure Threshold
Maximum Failure Threshold

: 0
: OK
: System Fan
: 2380
: 600
: 5700
: 500
: 6000

Four hours later, you repeat the command. You have no interest in the 11:00 A.M. snapshot as written to fans.txt. You type the same command:

omreport chassis fans index=0 -outc fans.txt

The 3:00 P.M. data overwrites the 11:00 A.M. data in the fans.txt file.

Fans.txt now reads as follows:

Index
Status
Probe Name
Reading
Minimum Warning Threshold
Maximum Warning Threshold
Minimum Failure Threshold
Maximum Failure Threshold

: 0
: OK
: System Fan
: 3001
: 700
: 5500
: 500
: 6000

You cannot refer to the previous command results to compare the earlier fan probe 0 output with the present output because in using the -outc option, you overwrote the fans.txt file.

Append Command Results to an Existing File

Use the -outa option when you want to append new command results to data stored in a previously written file. For example, at 11:00 A.M. you capture fan probe RPM readings for fan probe 0 on your system and write the results to a file called fans.txt. If you want to compare these results with output for the same probe obtained four hours later, you can use the -outa command to append the new output to fans.txt. Type:

omreport chassis fans index=0 -outa fans.txt

Fans.txt now reads as follows:

Index
Status
Probe Name
Reading
Minimum Warning Threshold
Maximum Warning Threshold
Minimum Failure Threshold
Maximum Failure Threshold

: 0
: OK
: System Fan
: 2380
: 600
: 5700
: 500
: 6000


Index
Status
Probe Name
Reading
Minimum Warning Threshold
Maximum Warning Threshold
Minimum Failure Threshold
Maximum Failure Threshold


: 0
: OK
: System Fan
: 3001
: 700
: 5500
: 500
: 6000

You can use a text editor to insert the time that each block of data was captured. In comparing the two snapshots for fan probe 0, you can see that the second report shows several changes. The reading of fan RPM has increased by 621 RPM but is still within normal range. Someone has raised the minimum warning threshold by 200 RPM and has decreased the maximum warning threshold by 2000 RPM.

Selecting a Format for Your CLI Command Output

You can specify a format for your CLI command results. The format determines how the command output is displayed. If the command results are directed to a file, the format is captured by the file to which you write your command results.

NOTE: The omconfig command ignores most output format options and returns plain text messages. However, if you use the xml option, the omconfig command returns XML code.

The available formats include:

Syntax for the formatting option is:

<command> -fmt <format option>

For example, type:

omreport system summary -fmt tbl

where -fmt tbl specifies table format.

You can combine the formatting option with the option to direct output to a file. For example, type:

omreport system summary -fmt tbl -outa summary.txt

where -fmt tbl specifies table format and -outa specifies that you append the command results to a file called summary.txt.

List (lst)

The default format is lst or list format. Use this format when you want to optimize output for simple readability. You need to specify a format for your command output only if you want a format other than lst format.

To see the following example command output in lst format, type:

omreport system summary

No special formatting option is required because list format is the default display format. The network data part of the example system summary appears as follows:

--------------

Network Data

--------------

Network Interface Card 0 Data
IP Address      : 143.166.152.108
Subnet Mask     : 255.255.255.0
Default Gateway : 143.166.152.1
MAC Address     : 00-02-b3-23-d2-ca

Table (tbl)

Use the tbl or table formatting option to have your data formatted in table rows and columns. To see the following example command output in table format, type:

omreport system summary -fmt tbl

The example output displays as follows:

------------------------------
Network Interface Card 0 Data
------------------------------

| ATTRIBUTE       | VALUE
| IP Address      | 143.166.152.108
| Subnet Mask     | 255.255.255.0
| Default Gateway | 143.166.152.1
| MAC Address     | 00-02-b3-23-d2-ca

Semicolon-separated Values (ssv)

Use the ssv formatting option to deliver output formatted in semicolon-separated Value format. This format also allows you to import your command output results into a spreadsheet program such as Microsoft Excel, or into a database program. To see the following example command output in semicolon-separated value format, type:

omreport system summary -fmt ssv

The example output displays as follows:

------------------------------
Network Data
------------------------------

Network Interface Card 0 Data
IP Address;143.166.152.108
Subnet Mask;255.255.255.0
Default Gateway;143.166.152.1
MAC Address;00-02-b3-23-d2-ca

Raw XML (xml)

Use the xml formatting option to produce output suitable for use by systems management applications or for input into other applications that use xml. To see the following example command output in raw xml format, type:

omreport system summary -fmt xml

The example output displays as follows:

<NICStatus>1</NICStatus><IPAddress>143.166.152.108</IPAddre ss><SubnetMask>255.255.255.0</SubnetMask><DefaultGateway>14 3.166.152.1</DefaultGateway><MACAddr>00-02-b3-23-d2- ca</MACAddr>


Back to Contents Page