How to convert a sysstat sa file into a plain-text sar file

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • sysstat

Issue

  • Need to convert a sysstat-generated sa file (e.g. /var/log/sa/sa11) into a human-readable sar text file.

Resolution

  • To process an sa data file, a system of the same architecture that created the file will be required. Additionally, the sysstat package will need to be the same major version. (E.g., an x86_64 machine can generate a sar file from an sa file created on another x86_64 machine but an i386/i686 system would not be able to. Similarly, a RHEL 6 system could not convert a sa file that was created by a RHEL 5 system.)

  • Once an appropriate system has been procured and the sysstat package has been installed, run the following command to convert the file. (Note that the names sa11 and sar11 are only used as an example.)

    # LC_TIME=POSIX sar -A -t -f /tmp/sa11 >/tmp/sar11
    

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.

Comments