I'm on RHEL
. How can i extend the log interval of SAR Reports to be more then a month? Normally the daily SAR reports are something like:
[root@server /]# cat /var/log/sa/sa
sa01 sa21 sa23 sa25 sa27 sa29 sa31 sar21 sar23 sar25 sar27 sar29 sar31
sa20.bz2 sa22 sa24 sa26 sa28 sa30 sar20 sar22 sar24 sar26 sar28 sar30
It means it stores daily reports for one month only.
- How do i store (for e.g) 3 months?
sar
appends the day-of-month to each file, so as you've seen it will only keep one month's worth of data.To keep more, simply archive the output to another directory.
sar
will still be able to read them using the-f
flag.You can do this by setting the
HISTORY
parameter to the number of days you want to keep the log files. The configuration file is/etc/sysconfig/sysstat
. Although the maximum number of days you can set is 28, if you want to keep the saDD format log files in the/var/log/sa
directory only, you are still allowed to set it to greater than 28 days. If set to more than 28 days, the log files will be stored in a month-by-month directory. So your sar log files will be pointing to a symlink toYYYYMM/saDD
log file. This will be taken care of by thesa1
script in cron.Check out the following links for the details - monthly sar reports and systat facts (section 2.19).