SAR

Andrei Pascal andrei at romsym.ro
Fri Apr 20 07:11:13 UTC 2007


On Thu, 2007-04-19 at 06:23 -0700, Sean McGlynn wrote:
> Andrei,
> 
> Thank you for taking the time to reply.  What doesn't make sense to me is that /etc/sysconfig/sysstat is configured with HISTORY=7, but there are nine days of files being maintained.
> 
> Thanks.
> 
> Sean

Sory for late answer: my laptop has HISTORY=7 but I have 14 days worth
of logs :) Doesn't make sense, just like you said.

However, digging a bit into sysstat I found something interesting:
----------------
[root at ave sa]# cat /usr/lib/sa/sa2
#!/bin/sh
# /usr/lib/sa/sa2.sh
# (C) 1999-2006 Sebastien Godard (sysstat <at> wanadoo dot fr)
#
# Changes:
# - 2004-01-22 Nils Philippsen <nphilipp <at> redhat dot com>
#   make history configurable
#
HISTORY=7
[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat
[ ${HISTORY} -gt 28 ] && HISTORY=28
S_TIME_FORMAT=ISO ; export S_TIME_FORMAT
umask 0022
DATE=`date  +%d`
RPT=/var/log/sa/sar${DATE}
ENDIR=/usr/bin
DFILE=/var/log/sa/sa${DATE}
[ -f "$DFILE" ] || exit 0
cd ${ENDIR}
${ENDIR}/sar $* -f ${DFILE} > ${RPT}
find /var/log/sa \( -name 'sar??' -o -name 'sa??' \) -mtime \
	+"${HISTORY}" -exec rm -f {} \;
----------------

And guess who's sa2 and what's it doing:
----------------
[root at ave sa]# cat /etc/cron.d/sysstat
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A
----------------


So, if you nedd to adjust its behaviour, just adjust /usr/lib/sa/sa2.



Regards,
Andrei




More information about the redhat-list mailing list