How do I log activity in a terminal session to give to Red Hat Support?
Environment
- Red Hat Enterprise Linux (RHEL)
- Red Hat Enterprise Linux Atomic Host
Issue
- I need to provide a log of activity from a terminal window for support.
- How to record terminal session to share with Red Hat Support?
- How do I share interactive data (terminal session) with Red Hat Support?
- How to share a text screencast with Red Hat Support to clarify your problem/question?
- How to make a video of all commands executed on Linux terminal or shell?
- Is there any tool to record Linux terminal session?
- How to use GNU script?
Resolution
What is script and scriptreplay commands?
The script command makes a typescript of everything displayed on the terminal, while scriptreplay plays back typescripts generated by script, using timing information to ensure that output happens in the same rhythm as it originally appeared when the script was recorded.
Why am I being asked to provide script?
During Red Hat support interaction, there are times that the sosreport alone is not able to show the issue occurring first-hand, especially when there does not seem to be an obvious explanation via the standard system log files.
The script and scriptreplay tools are installed by default as part of util-linux package.These commands provide a media player type of terminal output from the system, which allows to view actions taken within a specific terminal and the immediate output to obtain information needed to progress to case resolution.
How can I record a terminal session?
Disclaimer: recorded files do not contain any internal system information other than commands executed on the terminal. Before attaching these files in the support case, please ensure that no confidential/sensitive information was exposed in the terminal while running commands during the recorded session. If you believe you have accidentally uploaded sensitive information to a case, please contact Red Hat via phone or directly through the support case.
-
Open a new terminal window dedicated to the activity that will be performed. Execute the following command to record terminal session:
# script --timing=timedata.tm session.out- Where:
timedata.tm- file containing timing data of the executed commands.session.out- file containing executed commands and their output information.
- Where:
-
Perform any activities needed to be recorded for support's analysis. Type the commands which will demonstrate the issue. If you are unsure what to provide please ask Red Hat for clarification.
-
Once finished, enter
exitcommand or pressControl-Dto finish the recording and save the log. -
Check the recorded terminal session with
scriptreplaycommand:# scriptreplay --timing=timedata.tm --typescript=session.out -
Create a compressed tarbal containing both files:
# tar cf session_$(date +%d%m_%H%M).tgz timedata.tm session.out -
Attach
session*.tgzfile to the case using Red Hat Customer Portal. Refer to How to provide files to Red Hat Support (vmcore, rhev logcollector, sosreports, heap dumps, log files, etc.)
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.