Viewing switch configuration and operation

In some troubleshooting scenarios, you may need to view the switch configuration to diagnose a problem. The complete switch configuration is contained in a file that you can browse from the CLI using the commands described in this section.

Viewing the startup or running configuration file

Syntax:

write terminal

Displays the running configuration.

show config

Displays the startup configuration.

show running-config

Displays the running-config file.

For more information and examples of how to use these commands, see “Switch Memory and Configuration” in the Basic Operation Guide.

Viewing the configuration file (WebAgent)

To display the running configuration using the WebAgent:

  1. In the navigation pane, click Troubleshooting.

  2. Click Configuration Report.

  3. Use the right-side scroll bar to scroll through the configuration listing.

Viewing a summary of switch operational data

Syntax:

show tech

By default, the show tech command displays a single output of switch operating and running-configuration data from several internal switch sources, including:

  • Image stamp (software version data)

  • Running configuration

  • Event Log listing

  • Boot history

  • Port settings

  • Status and counters — port status

  • IP routes

  • Status and counters — VLAN information

  • GVRP support

  • Load balancing (trunk and LACP)

The show tech command shows sample output from the show tech command.

The show tech command

HP Switch# show tech

 show system

  Status and Counters - General System Information

   System Name        : Switch
   System Contact     :
   System Location    :

   MAC Age Time (sec) : 300

   Time Zone          : 0
   Daylight Time Rule : None

   Software revision  : XX.14.xx     Base MAC Addr  : 001871-c42f00
   ROM Version        : XX.12.12     Serial Number  : SG641SU00L

   Up Time            : 23 hours    Memory - Total :
   CPU Util (%)       : 10                    Free :

   IP Mgmt - Pkts Rx  : 759         Packet - Total : 6750
              Pkts Tx : 2             Buffers Free : 5086
                                            Lowest : 4961
                                            Missed : 0

show flash
Image       Size(Bytes)   Date  Version
-----       -----------  ------ --------

To specify the data displayed by the show tech command, use the copy show tech command as described in Customizing show tech command output.

Saving show tech command output to a text file

When you enter the show tech command, a summary of switch operational data is sent to your terminal emulator. You can use your terminal emulator's text capture features to save the show tech data to a text file for viewing, printing, or sending to an associate to diagnose a problem.

For example, if your terminal emulator is the Hyperterminal application available with Microsoft® Windows® software, you can copy the show tech output to a file and then use either Microsoft Word or Notepad to display the data. (In this case, Microsoft Word provides the data in an easier-to-read format.)

The following Example: uses the Microsoft Windows terminal emulator. If you are using a different terminal emulator application, see the documentation provided with the application.

  1. In Hyperterminal, click on Transfer|Capture Text…(see Capture text window of the Hyperterminal application).

    Capture text window of the Hyperterminal application

    Capture text window of the Hyperterminal application
  2. In the File field, enter the path and file name in which you want to store the show tech output, as shown in Entering a path and filename for saving show tech output.

    Entering a path and filename for saving show tech output

    Entering a path and filename for saving show tech output
  3. Click [Start] to create and open the text file.

  4. From the global configuration context, enter the show tech command:

    HP Switch# show tech
    

    The show tech command output is copied into the text file and displayed on the terminal emulator screen. When the command output stops and displays -- MORE --, press the Space bar to display and copy more information. The CLI prompt appears when the command output finishes.

  5. Click on Transfer|Capture Text|Stop in HyperTerminal to stop copying data and save the text file.

    If you do not stop HyperTerminal from copying command output into the text file, additional unwanted data can be copied from the HyperTerminal screen.

  6. To access the file, open it in Microsoft Word, Notepad, or a similar text editor.

Customizing show tech command output

Use the copy show tech command to customize the detailed switch information displayed with the show tech command to suit your troubleshooting needs.

To customize the information displayed with the show tech command:

  1. Determine the information that you want to gather to troubleshoot a problem in switch operation.

  2. Enter the copy show tech command to specify the data files that contain the information you want to view.

Syntax:

copy <source> show-tech

Specifies the operational and configuration data from one or more source files to be displayed by the show tech command. Enter the command once for each data file that you want to include in the display.

Default: Displays data from all source files, where <source> can be any one of the following values:

command-output "<command>"

Includes the output of a specified command in show-tech command output.

Enter the command name between double-quotation marks, For example, copy "show system" show-tech.

crash-log

Copies the contents of the Crash Log to show tech command output.

event-log

Copies the contents of the Event Log to show tech command output.

tftp config <startup-config | running-config <ip-addr> <remote-file> <pc | unix>

Downloads the contents of a configuration file from a remote host to show tech command output, where:

<ip-addr>: Specifies the IP address of the remote host device.

<remote-file>: Specifies the pathname on the remote host for the configuration file whose contents you want to include in the command output.

pc|unix: Specifies whether the remote host is a DOS-based PC or UNIX workstation.

For more information on using copy tftp commands, see File Transfers.

xmodem config <startup-config | config <filename> | command-file <acl-filename.txt> <pc | unix>

Copies the contents of a configuration file or ACL command file from a serially connected PC or UNIX workstation to show tech command output, where:

startup-config: Specifies the name of the startup configuration file on the connected device.

config <filename>: Specifies the pathname of a configuration file on the connected device.

command-file <acl-filename.txt>: Specifies the pathname of an ACL command file on the connected device.

pc|unix: Specifies whether the connected device is a DOS-based PC or UNIX workstation.

For more information on using copy xmodem commands, see File Transfers.

Viewing more information on switch operation

Use the following commands to display additional information on switch operation for troubleshooting purposes.

Syntax:

show boot-history

Displays the crash information saved for each management module on the switch.

show history

Displays the current command history. This command output is used for reference or when you want to repeat a command (See Displaying the information you need to diagnose problems).

show system-information

Displays globally configured parameters and information on switch operation.

show version

Displays the software version currently running on the switch and the flash image from which the switch booted (primary or secondary). For more information, see "Displaying Management Information" in the "Redundancy (Switch 8212zl)" chapter.

show interfaces

Displays information on the activity on all switch ports (see "Viewing Port Status and Configuring Port Parameters" in the "Port Status and Configuration" chapter).

show interfaces-display

Displays the same information as the show interfaces command and dynamically updates the output every three seconds. Press Ctrl + C to stop the dynamic updates of system information. Use the Arrow keys to view information that is off the screen.

Searching for text using pattern matching with show command

Selected portions of the output are displayed, depending on the parameters chosen.

Syntax:

show <command option> | <include | exclude | begin> <regular expression>

Uses matching pattern searches to display selected portions of the output from a show command. There is no limit to the number of characters that can be matched. Only regular expressions are permitted; symbols such as the asterisk cannot be substituted to perform more general matching.

include

Only the lines that contain the matching pattern are displayed in the output.

exclude

Only the lines that contain the matching pattern are not displayed in the output.

begin

The display of the output begins with the line that contains the matching pattern.


[NOTE: ]

NOTE: Pattern matching is case-sensitive.


Below are examples of what portions of the running config file display depending on the option chosen.

Pattern matching with include option

HP Switch(config)# show run | include ipv6 1


   ipv6 enable
   ipv6 enable
ipv6 access-list "EH-01"
HP Switch(config)#

1

Displays only lines that contain “ipv6”.

Pattern matching with exclude option

HP Switch(config)# show run | exclude ipv6 1



Running configuration:

; J9299A Configuration Editor; Created on release #RA.15.XX

hostname "HP Switch"
snmp-server community "notpublic" Unrestricted
vlan 1
  name "DEFAULT_VLAN"
  untagged 1-24
  ip address dhcp-bootp
  no untagged 21-24
  exit
vlan 20
  name "VLAN20"
  untagged 21-24
  no ip address
  exit
policy qos "michael"
  exit
  sequence 10 deny tcp 2001:db8:255::/48 2001:db8:125::/48
  exit
no autorun
password manager

1

Displays all lines that do not contain “ipv6”.

Pattern matching with begin option

HP Switch(config)# show run | begin ipv6 1


   ipv6 enable
   no untagged 21-24
   exit
vlan 20
   name "VLAN20"
   untagged 21-24
   ipv6 enable
   no ip address
   exit
policy qos "michael"
   exit
ipv6 access-list "EH-01"
   sequence 10 deny tcp 2001:db8:255::/48 2001:db8:125::/48
   exit
no autorun
password manager

1

Displays the running config beginning at the first line that contains “ipv6”.

The show arp command and pattern matching with the include option is an Example: of the show arp command output, and then the output displayed when the include option has the IP address of 15.255.128.1 as the regular expression.

The show arp command and pattern matching with the include option

HP Switch(config)# show arp

 IP ARP table

  IP Address      MAC Address    Type    Port
  -------------   -------------- ------- ----
  15.255.128.1    00000c-07ac00  dynamic B1
  15.255.131.19   00a0c9-b1503d  dynamic
  15.255.133.150  000bcd-3cbeec  dynamic B1


HP Switch(config)# show arp | include 15.255.128.1
  15.255.128.1    00000c-07ac00  dynamic B1

Displaying the information you need to diagnose problems

Use the following commands in a troubleshooting session to more accurately display the information you need to diagnose a problem.

Syntax:

alias

Creates a shortcut alias name for commonly used commands and command options.

Syntax:

kill

Terminates a currently running, remote troubleshooting session. Use the show ip ssh command to list the current management sessions.

Syntax:

[no] page

Toggles the paging mode for show commands between continuous listing and per-page listing.

Syntax:

repeat

Repeatedly executes one or more commands so that you can see the results of multiple commands displayed over a period of time. To halt the command execution, press any key on the keyboard.

Syntax:

setup

Displays the Switch Setup screen from the menu interface.