Administrator
|
This post was updated on .
Hi,
You need to write a script for this.
I have written one.
This script will report SAR data weekly and it has options to report CPU utilization, SWAP operations and LOAD AVERAGE. (WEEKLY!)
echo "What dou you want to report? (weekly report -- last 7 days)"
echo type 1 for Load Average Report
echo type 2 for Cpu utilization
echo type 3 swapin/swapout operations
read choice
case "$choice" in
1)
sar_reporting_argument="-q"
;;
2)
sar_reporting_argument="-u"
;;
3)
sar_reporting_argument="-W"
;;
*)
esac
day_high_count=`date +%d`
let day_counter=$day_high_count-7
while [ $day_counter -le $day_high_count ] ; do
day_counter_2digit="0${day_counter}"
day_counter_2digit="${day_counter_2digit: -2}"
sar `echo $sar_reporting_argument` -f /var/log/sa/sa`echo $day_counter_2digit`
echo $day_high_count
let day_counter=$day_counter+1
done
Example run:
[root@daroravmsrv1 ~]# sh /tmp/sar_weekly_load_average
What dou you want to report? (weekly report -- last 7 days)
type 1 for Load Average Report
type 2 for Cpu utilization
type 3 swapin/swapout operations
1 (my input)
After executing the script and producing the output, you can get the data from your shell to excel and do lots of reporting stuff . Optionally, you can enhance the script to put these sar outputs into html tables and even into the html graphs.
|