Using the CLI

From DocWiki

Jump to: navigation, search

Contents

Using FACT Command Arguments

An argument is a text expression that denotes one or more objects in the fabric. Arguments are used as srguments to the FACT commands.

Using Singular Arguments

This section describes the syntax for each type of argument. Table 1 lists the argument syntax and the corresponding descriptions.


Table 1: Argument Syntax

Syntax Argument Description
scan Scans are numbered chronologically starting from 1. (1 is the oldest; N is the latest.) The latest scan can be specified as “latest.” The show history command shows the number of each scan.
file A file or pathname is used by the FACT host platform.
switch A switch can be specified in one of the following ways:
  • hostname or IP address of its management port, as specified in the managed-node definition. See About Managed Node Definitions Files.
  • chassis GUID, using the notation 00:11:22:33:44:55:66:77.
  • given name of its chassis GUID (from guid name definition).
  • description of one of its chips, prepended by “chassis,” as shown in the following example:
chassis:00:11:22:33:44:55:66:77 (a node GUID)
host A host can be specified in one of the following ways:
  • hostname or IP address, as specified in the managed-node definition.
  • given name of its HCA node GUID (from guid name definitions).
  • node GUID of its HCA, prepended by “chassis.”
chassis A chassis is either a host or a switch. Any of the previously listed notations for host or switch may be used.
managed-node A managed node is either a host or a switch. It must be specified exactly as it appears in the managed-node part of the configuration. See About Managed Node Definitions Files.
chip A chip is an InfiniBand switch chip or InfiniBand channel adapter chip. It may be specified in the following ways:
  • node GUID.
  • given name from the GUID name definitions.
  • the notation switch/slot:index, where switch is a switch name, as described above, slot is a slot number (decimal integer) in a switch, and index is a decimal number. FACT orders chips in a slot by the node GUID. FACT numbers chips from 1 to n, ordered by their node GUIDs, going in ascending order from lowest to highest.
port A port may be specified as a port GUID, relative to a chassis or relative to a chip. As a port GUID, it is specified in eight hexadecimal octets separated by colons, as shown in the following example:
00:02:c9:02:00:22:2a:c8

Note: Most switch chips do not have port GUIDs.

Chassis-relative form has the 'syntax switch/slot/ext-number, where ext-number is the external port number. Switch has any of the previously listed forms, as shown in the following example:

switch01/2/3
(port 3 on slot 2 of chassis switch01)

Note: Internal chips can be specified in chip-relative syntax only.

Chip-relative form has the syntax chip/internal-number, where chip is an InfiniBand chip as previously listed, and internal number is the port number on the chip, as shown in the following examples:

switch01/2:3/4
(chip port 4 on chip 3 of the card in slot 2 of chassis switch01)
00:02:c9:02:00:22:2a:c4/4
(chip port 4 on the chip with the given GUID)
LID A LID is a decimal integer.
MLID A multicast LID is a decimal integer.

Using Plural Arguments

Many of the commands in FACT can accept plural arguments. The plurals can be built in several ways. Several alternatives can be separated by commas, with no spaces, as shown in the following example:

switch01,switch02

Each alternative may contain one or more ranges. A range is surrounded by square brackets and contains one or more comma-separated alternatives. Each alternative may be a single value or a hyphen-separated range of values, as shown in the following example:

rack[A-C,E]-host[01-10]
(rackA-host01 through rackA-host10, and similarly for racks B, C, and E, skipping rackD)

Scans, LIDs, and slot, chip, and port numbers are always numeric, so ranges may be specified without the square brackets, as shown in the following example:

switch03/1/1-4
(ports 1 through 4 on slot 1 of chassis switch03)

A plural scan always describes a single object in a simple form (by not using any alternatives or images), as shown in the following example:

switch03


FACT uses the following plural arguments:

  • LIDs
  • chassis
  • chips
  • hosts
  • managed-nodes
  • multicast-groups
  • ports
  • scans
  • switches


Note: Because all keywords can be abbreviated to a unique prefix, plural keywords such as chips and ports can be abbreviated to chip and port for the most common case of referring to a single unit. They keyword chassis can be either singular or plural.


Using Command Modes

FACT has two modes of operation:

  • Interactive command-line processor mode
  • Single-use command mode that performs a single function


Using Interactive Mode

As a command-line program, FACT reads commands from its input, parses them, and writes their output to its output. The following sample output shows FACT interactive mode:

  $ fact
  Cisco FACT 1.0
  Copyright 2008, Cisco Systems, Inc.
  fact> scan fabric
  fact> show versions
  name                    version
  ----------------------- -------------------------------------
  switch01		  TopspinOS 2.9.0 releng #147 10/25/...
  switch02		  TopspinOS 2.8.0 releng #154 07/11/...
  fact> exit
  $

Using Single-Command Mode

In single-command mode, a single command is passed to FACT as the program command arguments. FACT then runs the command, prints the results, and exits.

The following sample output shows the FACT single-command mode:

  $ fact scan fabric
  $ fact show versions
  name                    version
  ----------------------- -------------------------------------
  switch01		TopspinOS 2.9.0 releng #147 10/25/...
  switch02		TopspinOS 2.8.0 releng #154 07/11/...
  $ 

As a variant of single-command mode, the first word of the command, usually the verb, can be joined to the FACT name with a hyphen. The following sample output shows the FACT single-command mode:

  $ fact-scan fabric
  $ fact-show versions

To use shell completion to see available commands, join the FACT name with a hyphen, and enter the tab key:

  $ fact-<TAB>



Command-line Interface

FACT looks for several environmental variables and accepts several command-line options. This section describes the FACT command-line interface and shows how to use it.


Command-line Options

Table 2 lists and describes the command-line options.


Table 2: Command-line Options

Option Description
-c file

--config-file=file

Reads primary configuration from the specified file.
--color=always If tracing, specifies that the transcript is colorized, showing FACT requests in one color and the switch responses in another.
--color=auto If tracing, specifies that the transcript is colorized only if the FACT standard output is a terminal. This behavior is the default.
--color=never If tracing, specifies that the transcript is not colorized.
--config-option=

option

Adds or overrides a configuration option.
--credentials-from=file Adds credential information from the file.

See About Credentials Files.

--guid-name=guid=name Adds a GUID name definition.

See About GUID Name Definitions section.

--guid-names-

from=file

Adds GUID name definitions from the specified file.

See About GUID Name Definitions.

-h

--help

Prints a message describing messages.
--help-commands Lists FACT commands.
--managed-nodes-=type: pattern Adds a set of managed-nodes to those about which FACT is aware.

See About Managed Node Definitions Files.

--managed-nodes-from=file Adds managed-nodes from the file.

See About Managed Node Definitions Files.

-s

--sequential

Initiates sequential scan sessions to one managed node at a time. This option is helpful with the --trace command because output displays slower and more predictably. By default, FACT connects up to 50 managed nodes at a time during scans and installations. If sequential is specified, then FACT connects to one managed node at a time.
--subnet-manager=domain name or IP address Specifies the InfiniBand Subnet Manager host that FACT should use.
--trace and --sequential Runs sequential sessions to managed nodes and prints the session transcript.
-t

--trace

By default, if --trace is not specified, then FACT will print the transcript of each session when that session is closed. If --trace is specified, FACT will print the transcript of each session as it occurs.
-v

--version

Prints FACT version information and exits.

Environment Variables

FACT uses environment variables to control the FACT configuration. Table 3 lists and describes the FACT environment variables.


Table 3: Environment Variables

Variable Description
FACT_CONF Name of master configturation file.

See About Master Configuration Files.

FACT_CREDENTIAL_FILES List of files that contain credentials, separated by colons, as shown in the following example:
FACT_CREDENTIAL_FILES=/etc/fact/cred1:/etc/fact/cred2
states that the files /etc/fact/cred1 and /etc/fact/cred2 contain GUID name definitions

See About Credentials Files.

FACT_GUID_NAMES List of GUID name definitions, separated by semicolons. Each definition has the form “GUID=name,” as shown in the following example:
FACT_GUID_NAMES="00:1b:0d:0b:00:00:ca:a6=switchA;00:1b:0d:0b:00:00:ca:aa=switchB"
defines switchA as the name for 00:1b:0d:0b:00:00:ca:a6 and switchB as the name for 00:1b:0d:0b:00:00:ca:aa

See About GUID Name Definitions.

FACT_GUID_NAME_FILES List of files containing GUID name definitions, separated by colons, as shown in the following example:
FACT_GUID_NAME_FILES=/tmp/guidnames1:/tmp/guidnames2 states that the files /tmp/guidnames1 and /tmp/guidnames1 contain GUID name definitions

See About GUID Name Definitions.

FACT_MANAGED_NODES In-line list of managed node definitions, separated by colons, as shown in the following example:
FACT_MANAGED_NODES="host=ibmg-r1-evil:SFSOS switch=209.165.200.225
defines a host named ibmg-r1-evil and an SFS OS switch named 209.165.200.225

See About Managed Node Definitions Files.

FACT_MANAGED_NODE_FILES List of files containing managed node definitions, separated by colons, as shown in the following example:
FACT_MANAGED_NODE_FILES=/tmp/nodefile1:/tmp/nodefile2
states that the files /tmp/nodefile1 and /tmp/nodefile2 contain managed node definitions

See About Managed Node Definitions Files.

Correcting Commands

Note: This feature will be functional at FCS.


The system response to command line-errors is different when you use the question mark (?) to obtain help for a command. In this case, the system repeats your input following the subsequent prompt for ease of editing, as shown in the following example:

  fact> show interfce ?
                  ^
  % Error: Unrecognized command
  fact> show interfce


Editing the CLI

Command-line editing lets you modify a command line command that you have just entered or a command line that you entered previously in the CLI session. The CLI supports a variety of ways to move about and edit the currently displayed command line. Table 4 lists and describes these options.


Table 4: Key Stroke Shortcuts

Key Strokes Description
Ctrl-A Moves the cursor to the beginning of the line.
Ctrl-B Moves the cursor to the left (backward) one character.
Ctrl-D Deletes the current character. Exits FACT if the current input line is empty.
Ctrl-E Moves the cursor to the end of the line.
Ctrl-F Moves the cursor to the right (forward) one character.
Ctrl-G Erases the current input line.
Ctrl-H Deletes the character to the left of the cursor, analogous to the Backspace key.
Ctrl-I Completes the current word, analogous to the Tab key.
Ctrl-J Accepts the current line.
Ctrl-K Deletes text from the cursor to the end of the line.
Ctrl-L Refreshes the input line.
Ctrl-M Accepts the current line, analogous to the Return key.
Ctrl-N Proceeds to the next line in the command history.
Ctrl-P Moves to the previous line in the command history.
Ctrl-T Transposes the current and previous characters.
Ctrl-U Deletes all text to the left of the cursor, back to the beginning of the line.
Ctrl-W Deletes the word to the left of the cursor.
Ctrl-Z Suspends the FACT.
Ctrl-Del Deletes the chatacter to the left of the cursor, analogous to the Delete key.
? Completes the current word.
Esc-[A Moves to the previous line in the command history.
Esc-[B Proceeds to the next line in the command history.
Esc-[C Moves the cursor to the right (forward) one character.
Esc-[D Moves the cursor to the left (backward) on character.
Esc-B Moves the cursor to the left (backward) one word.
Esc-C Capitalizes the word to the right of the cursor (forward).
Esc-D Deletes characters from the cursor through the end of the word.
Esc-F Moves the cursor right (forward) one word.
Esc-L Converts characters, from the cursor to the end of the word, to lowercase.
Esc-U Converts characters, from the cursor to the end of the word, to uppercase.
Esc-Ctrl-H Deletes the word to the left of the cursor.
Esc-Delete Deletes the word to the left of the cursor.
Down Arrow Proceeds to the next line in the command history.
Up Arrow Moves to the previous line in the command history.
Left Arrow Moves the cursor to the left (backward) one character.
Right Arrow Moves the cursor to the right (forward) one character.

Rating: 5.0/5 (1 vote cast)

Personal tools