How to change the collection interval of SAR data less than 1 minute in RHEL7 and older?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • Crond
  • Sysstat

Issue

  • SAR comes with 10 mins data collection interval by default. How to change it to an interval less than 1 minute?

Resolution

Important: The following procedures apply only for RHEL7 and older releases that use crond as task scheduler. For RHEL8 and above, please refer the solution How to change the collection interval of the SAR data in RHEL8 and above?

  • Edit /etc/cron.d/sysstat to run sa1 more frequently:

    • Changing the interval to 30 seconds:
    */1 * * * * root /usr/lib64/sa/sa1 1 1 ; sleep 30 ; /usr/lib64/sa/sa1 1 1
    
    • Changing the interval to 1 second:
    */1 * * * * root for i in `seq 1 59` ; do /usr/lib64/sa/sa1 1 1 ; sleep 1 ; done
    
Components
Category

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.