SAR — Accessing Raw Data

Preparing SAR Data for SAS IT Resource Management

System Activity Reporter (SAR) data can be collected from the following operating systems:
  • HP-UX 10.2 and later
  • IBM AIX 3.2 and later
  • SunOS Solaris 5.8 and later
  • Linux (Use Sysstat 4.0.1 or Sysstat 5.0.0 and later.)
SAR performance data can be set up to write continuously to a binary file by means of the sapd command. At appropriate intervals, the sar command can be used to write the binary file to an ASCII file. The ASCII file is input to a staging transformation of SAS IT Resource Management.
For information about the performance areas that are collected by SAR, see SAR Adapter - SAR Domain Category.

Extracting Data from SAR

The following sapd and sar commands and shell scripts that collect SAR data are usually available in the /usr/lib/sa directory:
  • The sapd command collects performance data into a binary file.
    The sa1 shell script is a wrapper for the sapd command and can be scheduled to run automatically through cron.
    By default, the binary file that is created by the sa1 shell script is called /var/adm/sa/sa$DATE (where $DATE is the current date). To save the binary data in a different location, modify the sa1 shell script accordingly.
    The following cron entry shows an example of running the sa1 shell script to collect performance data every five minutes. The sa1 shell script is run every 20 minutes by cron, and within the sa1 shell script, the sapd command collects data for four 300 second (that is, 5-minute) intervals:
    0,20,40 * * * * /usr/lib/sa/sa1 300 4  
  • The sar command extracts the data from the binary file that was created by the sapd command and creates an ASCII file that can be read by the SAR staging transformation of SAS IT Resource Management 3.1.1 and later.
    The sa2 shell script is a wrapper for the sar command, and can be scheduled to run automatically through cron.
    By default, the binary file is /var/adm/sa/sa$DATE. To change the location of the binary file or the location of the ASCII file, modify the sa2 shell script accordingly.
    The following cron entry shows an example of running the sa2 shell script on Linux to create ASCII files once a day at 12:55AM:
    55 0 * * * /usr/lib/sa/sa2 -A  
    Note: The switches for the sar command can be passed as parameters to the sa2 shell script.

Using the sar Command

The sar command can be used to collect the following types of data:
  • global data (data for the entire system)
  • processor level data (data for each processor on the system)
If processor level data is collected, it can be staged in the SARCPUB table. Each UNIX environment has its own set of options that can be specified with the sar command. SAS IT Resource Management recommends setting the following switches:
  • for HP-UX operating environments:
    To collect global data as well as per-processor data on HP-UX, you must create two files by executing two sar commands.
    • To collect global data, execute the following command:
      sar -A -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE_global 
    • To collect processor level data, execute the following command:
      sar -Mu -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE_processor
  • for AIX operating environments:
    To collect global data as well as per-processor data on AIX, you must create two files by executing two sar commands.
    • To collect global data, execute the following command:
      sar -bdkqrvy -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE_global
    • To collect processor level data, execute the following command:
      sar -A -P ALL -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE_processor
  • for Linux operating environments:
    To collect both global and processor level data, use the following sar command:
    sar -A -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE
  • for SunOS Solaris operating environments:
    You cannot capture processor level data on SunOS Solaris. To collect global data, execute the following sar command:
     sar -A -f /var/adm/sa/sa$DATE > /var/adm/sa/sar$DATE
All of the files that are created by the sar command should be placed in a single directory that is read by the staging transformation in SAS IT Resource Management 3.1.1 and later. In the staging transformation, all the files in this directory are read and used to update the SAR data mart.
Note: For more information, see your system's documentation about the sar and sapd commands and the sa1 and sa2 shell scripts.