HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: sar usage
Operating System - Linux
1827867
Members
1268
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
08-23-2005 12:24 AM
08-23-2005 12:24 AM
Hi,
I would like to measure the CPU utilization over a period of time (by specifying the start and end times).
May I know how do I specify the options to the "sar" command to in order not to specify the referenced log file? This is because I'm only interested in measuring the CPU utilization of particular time frame.Attached is the text file containing the error output when specifying the -s and -e options without the -f option for the log file.
Also,how to use sar to measure the CPU utilization for a particular application?
Could anyone kindly help me out?
I would like to measure the CPU utilization over a period of time (by specifying the start and end times).
May I know how do I specify the options to the "sar" command to in order not to specify the referenced log file? This is because I'm only interested in measuring the CPU utilization of particular time frame.Attached is the text file containing the error output when specifying the -s and -e options without the -f option for the log file.
Also,how to use sar to measure the CPU utilization for a particular application?
Could anyone kindly help me out?
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2005 12:48 AM
08-23-2005 12:48 AM
Re: sar usage
If I understood right, what you want to is not possible with the sar command. Do you want to collect performance statistics for a specific time?
The -s and -e options are only valid when you analyze a log file.
If you want to collect performance counters for a specific time, you should use the sadc command in a crontab entry.
The -s and -e options are only valid when you analyze a log file.
If you want to collect performance counters for a specific time, you should use the sadc command in a crontab entry.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2005 01:37 AM
08-23-2005 01:37 AM
Solution
Hi Danny ,
You can use sar to capture the CPU usage data over a long time.
vmstat for Virtual Memory statistics.
iostat for io statistics.
###########################################
#!/usr/bin/ksh
touch sar_cpu.txt ; touch vmstat.txt ; touch iostat.txt
i=0
while [ $i -le 60 ]
do
sar -u 5 12 >>sar_cpu.txt # 5 second interval .
vmstat 5 12 >> vmstat.txt
iostat 5 12 >> iostat.txt
echo "-----------------------"
i=`expr $i + 1`
done
echo " SAR data collected for 1 hr complete "
echo " CPU Data stored in the file sar_cpu.txt "
echo "Vmstat Data stored in the file vmstat.txt "
echo "iostat Data stored in the file iostat.txt "
echo "------------------------------------"
###########################################
You cannot measure the CPU utilisation for a particular application through sar , but hope you can do it with top , ps command. grep for cpu usage and sort the output.
cheers,
Raj.
You can use sar to capture the CPU usage data over a long time.
vmstat for Virtual Memory statistics.
iostat for io statistics.
###########################################
#!/usr/bin/ksh
touch sar_cpu.txt ; touch vmstat.txt ; touch iostat.txt
i=0
while [ $i -le 60 ]
do
sar -u 5 12 >>sar_cpu.txt # 5 second interval .
vmstat 5 12 >> vmstat.txt
iostat 5 12 >> iostat.txt
echo "-----------------------"
i=`expr $i + 1`
done
echo " SAR data collected for 1 hr complete "
echo " CPU Data stored in the file sar_cpu.txt "
echo "Vmstat Data stored in the file vmstat.txt "
echo "iostat Data stored in the file iostat.txt "
echo "------------------------------------"
###########################################
You cannot measure the CPU utilisation for a particular application through sar , but hope you can do it with top , ps command. grep for cpu usage and sort the output.
cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2005 01:40 AM
08-25-2005 01:40 AM
Re: sar usage
Danny,
use this syntax to have a complete report for sar ( included CPU utilization ):
sar -o sarfile 5 60
sar -Af sarfile > sar.report
Then have a look to the file sar.report
For the interpretation, have a look to the CPU section
Rgds,
Alex
use this syntax to have a complete report for sar ( included CPU utilization ):
sar -o sarfile 5 60
sar -Af sarfile > sar.report
Then have a look to the file sar.report
For the interpretation, have a look to the CPU section
Rgds,
Alex
if you don't try, you'll never know if you are able to
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP