- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: command to get CPU Utilization for RIGHT NOW?
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
Discussions
Discussions
Forums
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
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
тАО06-11-2009 05:00 AM
тАО06-11-2009 05:00 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 05:02 AM
тАО06-11-2009 05:02 AM
Re: command to get CPU Utilization for RIGHT NOW?
you could use glance.
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 05:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 05:10 AM
тАО06-11-2009 05:10 AM
Re: command to get CPU Utilization for RIGHT NOW?
top -f tmpfile
BUSY=`grep -E "^avg " file | sed 's/\%//g' | awk '// { print ( 100 - $6 ) }' `
echo "the CPU is ${BUSY}% busy."
rm tmpfile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2009 05:34 AM
тАО06-11-2009 05:34 AM
Re: command to get CPU Utilization for RIGHT NOW?
This will tell you what the per-CPU utilization is right now and for the next 10 seconds in 1 second intervals, providing an average for that 10 second time period as well.
Run the command and see the time stamps off to the left - those time stamps are RIGHT NOW.
If you are not using the timing parameters then yes, you will get average output from various times, but use those parameters and you will get you data in real time. In the above example, you are watching per-CPU utilization starting now and going forward for 10 seconds in 1 second intervals. The average provided at the completion of the command in for the last 10 seconds, the parameter that was used.
top and glance are just as good, no doubt, but don't leave out sar.