- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Sar output on Linux
Operating System - Linux
1753905
Members
10482
Online
108810
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
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
06-30-2009 02:21 PM
06-30-2009 02:21 PM
Sar output on Linux
hi all,
i used glance on hpux to gather system metrics, unfortunately on linux, glance has less values. So, i'm trying to use SAR to collect the metrics, unfortunately my tool that processes my datafile expects 1 line per timestamp. With sar, if i specify sar -u and -r then he'll generate 2 lines for the same timestampt:
03:20:27 PM CPU %user %nice %system %iowait %steal %idle
03:20:28 PM all 0.00 0.00 0.00 0.00 0.00 100.00
03:20:27 PM kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
03:20:28 PM 946668 2706144 74.08 88708 2466876 337196 128 0.04 60
IOs it possible to have everything on the same line for a given timestamp ? With a Awk or perl.
Thanks!
JB
i used glance on hpux to gather system metrics, unfortunately on linux, glance has less values. So, i'm trying to use SAR to collect the metrics, unfortunately my tool that processes my datafile expects 1 line per timestamp. With sar, if i specify sar -u and -r then he'll generate 2 lines for the same timestampt:
03:20:27 PM CPU %user %nice %system %iowait %steal %idle
03:20:28 PM all 0.00 0.00 0.00 0.00 0.00 100.00
03:20:27 PM kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
03:20:28 PM 946668 2706144 74.08 88708 2466876 337196 128 0.04 60
IOs it possible to have everything on the same line for a given timestamp ? With a Awk or perl.
Thanks!
JB
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2009 06:36 PM
06-30-2009 06:36 PM
Re: Sar output on Linux
>Is it possible to have everything on the same line for a given timestamp? With awk or perl.
Sure but you are going to have to explain exactly what you want. It appears something is terribly wrong with your sar output.
It seems you have a title line then data, then a different title and data.
I don't understand why the title line has a different timestamp than the data?
If you have more data in your file, do you have sets of those 4 lines? (Do you have blank lines?)
If you just have repeats of those 4 lines you can do:
awk '
{
getline L2
getline L3
getline L4
print $0, L3 # title
print L2, L4 # data
}' sar-file
Sure but you are going to have to explain exactly what you want. It appears something is terribly wrong with your sar output.
It seems you have a title line then data, then a different title and data.
I don't understand why the title line has a different timestamp than the data?
If you have more data in your file, do you have sets of those 4 lines? (Do you have blank lines?)
If you just have repeats of those 4 lines you can do:
awk '
{
getline L2
getline L3
getline L4
print $0, L3 # title
print L2, L4 # data
}' sar-file
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.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP