--- On Thu, 29/1/09, Satyawan Mhatre <[email protected]> wrote:
From: Satyawan Mhatre <[email protected]>
Subject: [Linux_Mantra] Calculation of Total Cpu utilization
To: [email protected]
Date: Thursday, 29 January, 2009, 11:05 AM
Dear all,
I want to calculate total % of cpu utilization per Day.
Server contains 12 CPU.
I am using IRIX 6.5 OS, vmstat not works in this OS
Please help me
Thanks & Regards
Satyawan Mhatre
use mpstat.
#!/bin/bash
#
# save this in /usr/local/bin/ mpstat.hourly or /local/bin/mpstat. hourly
INTERVAL=3600 # 3600 seconds/hour
STATCOUNT=1 # 1 iteration/execution of mpstat
while 1
do
DATE=`date +%Y.%m.%d`
LOGFILE=/var/ log/cpulog. $DATE
touch $LOGFILE # create log file if it doesn't exist
date
mpstat $INTERVAL $STATCOUNT >> $LOGFILE #append hourly
cumulative stats
[[ LOOPCOUNT = LOOPCOUNT - 1 ]]
done
in your startup scripts, create a script which starts the program above
/usr/local/bin/mpstat. hourly
Connect with friends all over the world. Get Yahoo! India Messenger at
http://in.messenger.yahoo.com/?wm=n/
[Non-text portions of this message have been removed]