script for cpu utilization for each user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script for cpu utilization for each user
# 1  
Old 03-27-2008
script for cpu utilization for each user

Can someone suggest me the script to calculate cpu utilization for each user
in solaris say for a period of 24 Hrs or last 12 Hrs
I am using solaris 10.

Thanks in Advance
# 2  
Old 03-28-2008
clear
vmstat|awk '{print $3}'|tail -1 > avm
svmon -G|grep memory|awk '{print $2}' > svmon
svmon -G|grep pg|awk '{print $3}' > pgsize
svmon -G|grep pg|awk '{print $4}' > pginuse
paste avm svmon pgsize pginuse > stats.txt
rm avm svmon pgsize pginuse
avm=`vmstat|awk '{print $3}'|tail -1`
svmon=`svmon -G|grep memory|awk '{print $2}'`
if [ $avm -le $svmon ] ; then
awk -f vmstat.awk stats.txt
else
awk -f vmstat1.awk stats.txt
fi

$ cat vmstat.awk
{
freemem = ($2 - $1)*4096
mem = freemem / 1000000000
print "Your free memory is : "mem"G"

#totalfree = $2 + ($3 - $4)
#free = totalfree / 1000000000
#print "Your total memory is :"free"G"
}
$ cat vmstat1.awk
{
totalfree = ($2 + $3 - $4 - $1)*4096
free1 = totalfree / 1000000000
print "Your total free mem is :" free1
}
$

somthing like this..but not sme as your pro.but here is the idea.
This User Gave Thanks to invinzin21 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

CPU Utilization and Memory Utilization of Services and Applications

Hi, i am new to linux/RHEL 6.0 and i have two questions. 1) How to get the CPU utilization and Memory Utilization of all Services running currently? 2) How to get the CPU utilization and Memory Utilization of all Applications running currently? Please help me to find the script. ... (2 Replies)
Discussion started by: nossam
2 Replies

2. Shell Programming and Scripting

Automated script for CPU utilization

I am new to production support on unix platform I need a script for the following requirement: to monitor CPU usage for all the time in a day on unix server.And it has to send mail if CPU hits 100% and the mail also contains which user,process occupying the maximum CPU usage.And if it contains the... (2 Replies)
Discussion started by: shreven
2 Replies

3. How to Post in the The UNIX and Linux Forums

URGENT need script for CPU utilization

Hi All I am new to production support on unix platform I need a script for the following requirement: to monitor CPU usage for all the time in a day on unix server.And it has to send mail if CPU hits 100% and the mail also contains which user,process occupying the maximum CPU usage.And if it... (1 Reply)
Discussion started by: shreven
1 Replies

4. Shell Programming and Scripting

Cpu utilization script

I have a set of requirement 1)cpu utilization on a server with pid and and process name. It should display the above and also the script should have an option to record the cpu utilization for a given period of time first part i can get with below commands ps -eo pcpu,pid,user,args or... (5 Replies)
Discussion started by: NarayanaPrakash
5 Replies

5. Cybersecurity

Limit CPU and RAM utilization for new user in RedHat

We have a system with 4 Xeon Processors each with 10 cores, total 512 GB RAM and 10 TB Hard Drive. we want to create multiple user accounts with different resource limitations as : User 1: RAM : 50GB, PROCESSOR: 10 Cores , User folder in home directory of 10GB space. User 2: RAM :... (5 Replies)
Discussion started by: vaibhavvsk
5 Replies

6. Shell Programming and Scripting

Script to note CPU and Memory Utilization

Hi, I need to write a script which would take the CPU and Memory usage at an interval of 10 mins. I tried using sar, but that does not solve my purpose. Its not only one system that i have, but approximately 10 server from where i need to achive this date. Can anyone share a script or idea... (1 Reply)
Discussion started by: Siddheshk
1 Replies

7. Shell Programming and Scripting

script to check high cpu utilization for java process

Hello Team, I need help in preparing script to check for high cpu utilisation for java process. I have many java process on my system which consumes high cpu so i have to monitor it using script. ---------- Post updated 12-10-10 at 02:21 AM ---------- Previous update was 12-09-10 at... (1 Reply)
Discussion started by: coolguyamy
1 Replies

8. Shell Programming and Scripting

High CPU Utilization of the script

There is a script which processes the incoming files from a particular directory and sleeps if it doesnt find any. Currently, i have been told that eventhough there are no files to process, the CPU utilization is very high. An independent evaluation by advisory specialist has found this script does... (2 Replies)
Discussion started by: nandu
2 Replies

9. AIX

AIX 6.1 Power6 - Sys CPU utilization twice that of User

Hello, We just purchased two new 4-way (one active one failover) 5Ghz Power6 Servers (failover) with 64GB RAM (32GB per node) runing AIX 6.1 with two LPARs per node connected to our SAN with two 4GB HBAs. The PROD LPAR has 2 dedicated CPUs (4 virtual) and the TEST LPAR has 2 dedicated CPUs. ... (3 Replies)
Discussion started by: troym72
3 Replies

10. Shell Programming and Scripting

Script with high CPU utilization

Hi All, i have a script that finds the file with .txt .zip .Z .gzip that are 3 days old in directory /abc/def and removes them find /abc/def -name '0*.txt' -mtime +6 -exec rm {} \; find /abc/def -name '0*.zip' -mtime +6 -exec rm {} \; find /abc/def -name '0*.gzip' -mtime +6... (3 Replies)
Discussion started by: mad_man12
3 Replies
Login or Register to Ask a Question