subscribe iconSubscribe to this information
POWER6 information

Capturing switch CLI output

You can collect data directly from a switch command-line interface (CLI) by using a script command.

If you are directed to collect data directly from a switch command-line interface, typically you would capture the output by using the script command, which is available on both the Linux® and AIX® operating systems. The script command captures the standard output (stdout) from the Telnet or ssh session by using the switch and places it into a file.

Note: You can use some terminal emulation utilities to capture the terminal session into a log file. This log file might be an acceptable alternative to using the script command.

To use the script command, perform the following steps:

  1. On the host from which you will log in to the switch, enter the following command:
    script /<dir>/switchname.capture.timestamp 
    • Select a directory into which to store the data.
    • It is helpful to have the name of the switch in the output filename.
    • It is helpful to put a timestamp into the output filename to differentiate it from other data collected from the same switch. If you use the following format, you are able to sort the files easily:
       <4-digit year><2-digit month><2-digit day>_<2-digit hour><2-digit minute>
  2. Use Telnet or ssh to access the command-line interface on the switch. For details, see the Switch Users Guide.
  3. Run the command to get the data that is being requested.
  4. Exit from the switch.
  5. To stop the script command from collecting more data, press CTRL+D.
  6. Send the output file to the appropriate support team.

Send feedback | Rate this page

Last updated: Tue, February 08, 2011