Redhat: System Status Reports

From Define Wiki
Jump to navigation Jump to search

System Status Service

To install the system status service install the sysstat package.

Sysstat is a regular service with a script in the /etc/init.d directory. It is cron job that runs a regular basis and is defined in /etc/cron.d.

The Sysstat service has two directives in /etc/sysconfig/sysstat:

HISTORY=7
COMPRESSAFTER=10

This will keep the sysstats for the past severn days. It will then compress the log files after 10 days. In this case the files will be deleted before they are compressesed.


Sysstat Cron Job

The Sysstat package includes a cron job that runs every 10 minutes by the root user. The job runs the sa1 command. The second command runs the sa2 command every day and seven minutes to midnight. These two commands produce a daily report.


Prepare a System Status Report

The binary log files produced by the cron job are stored in /var/log/sa/sa* The sadf command is used to create a report based in these files.

sadf -s 00:00:01 -e 23:59:59 /var/log/sa/sa21 > activity10

This command produces a report based on the stats from the 21 day including everything between the start and end times.