- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- CPU Utilization based on user
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 07:45 PM
11-19-2006 07:45 PM
This should be a easy 10 pointer... what is teh command to get total cpu utilization for user root or any other user. I am planning to use this command in a script.
Regards,
-Hasim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 08:24 PM
11-19-2006 08:24 PM
Re: CPU Utilization based on user
1. top -s 10 -d 1 -n 1000 -f /tmp/top.txt
2. awk '{if($4=="USERNAME"){p=1;getline;}if(p==1)cpu[$4]+=$11}END{for(u in cpu)print u,cpu[u]}' /tmp/top.txt
These commands add up all the cpu and outputs the total for each user.
Remember to remove /tmp/top.txt between each run, otherwise top appends to the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 08:35 PM
11-19-2006 08:35 PM
Re: CPU Utilization based on user
I hope this runs on HPUX 11.x ?
Also, can u please tell me if I have to sum the utilization for all the users it can be done wiht the same command ?
I am basically trying to make a script in which I total the utilzation for three users and than compare if it does not take more than 30 percent of total utilzation for all the users.
Thanks again
-Hasim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 08:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 09:01 PM
11-19-2006 09:01 PM
Re: CPU Utilization based on user
sort -rnk2 to get the worst users at the top of the list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2006 10:00 PM
11-19-2006 10:00 PM
Re: CPU Utilization based on user
Regards,
-Hasim