I am trying to figure a way to get the CPU utilization for the past 2 months. I have tried to use sar. What I found with sar is that you can collect and report CPU utilization with it and it is installed through the sysstat utility. Once installed the /usr/lib64/sa/sa1 directory stores "historical" references in the /var/log/sa/sadd directory where dd = day in the month. You setup specified parameters in the cron.d/sysstat file. Which for me looks like this:
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A
Then /usr/lib64/sa/sa2 creates a daily report in the /var/log/sa/sadd directory. Which for me sa2 looks like this:
#!/bin/sh
# /usr/lib64/sa/sa2.sh
# (C) 1999-2006 Sebastien Godard (sysstat <at> wanadoo.fr)
#
# Changes:
# - 2004-01-22 Nils Philippsen <[email protected]>
# make history configurable
#
HISTORY=7
[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat
[ ${HISTORY} -gt 25 ] && HISTORY=25
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 {} \;
This is only set to have the history of 7 days. I guess my question is: Is there a way to get the CPU stats for the past 2 months using sar or is there a better way? It seems to me I may only have access to the past 7 days of stats.