Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

# /usr/lib64/sa/
# (C) 1999-2006 Sebastien Godard (sysstat <at>
# Changes:
# - 2004-01-22 Nils Philippsen <>
#   make history configurable
[ -r /etc/sysconfig/sysstat ] && . /etc/sysconfig/sysstat
[ ${HISTORY} -gt 25 ] && HISTORY=25
umask 0022
DATE=`date  +%d`
[ -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.

share|improve this question
I don't know about SAR, but a tool like munin can definitely keep stats for several months. – Lucas Kauffman Sep 19 '12 at 14:38
up vote 0 down vote accepted

if you change to HISTORY=60, then it should keep 2 months worth, approximately.

share|improve this answer
Thanks for the response. That will be implemented. But is there a way to get the past 2 months without having this implemented before hand or are we SOL at this point? – Bassler1988 Sep 19 '12 at 16:30
I guess not, at least for sar, as the files were cleaned up by the script, unless you have other external programs that generated and kept stats. If your server is in a datacenter, your provider might have some standard monitoring to capture that. cpu utilization is one of the most basic things to monitor so if there is any monitoring, it should be there. – johnshen64 Sep 19 '12 at 17:57
Luckily you were right johnshen64. Just found out that we use TeamQuest. Nice little reporting tool. Thanks for all comments! – Bassler1988 Sep 19 '12 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .