1829380 Members
4546 Online
109991 Solutions
New Discussion

converting sar output

 
SOLVED
Go to solution
Stephen Young_1
Occasional Advisor

converting sar output

I run the following command in cron,
0 * * * */usr/lib/sa/sa1 60 60
The ouput gets sent to /var/adm/sa/saXX as expected.
Can anyone give me a script/command to convert
the existing sa files that have been generated into a format that Excel can read ?

Cheers in advance
5 REPLIES 5
Bill McNAMARA_1
Honored Contributor

Re: converting sar output

Have a look at the tr command that'll replace whitespace, tab, etc.. with whatever you want.

tr -s " " ","

Later,
Bill
It works for me (tm)
federico_3
Honored Contributor

Re: converting sar output

the sar command will translate into the ascii mode the /var/adm/sa/* files.
If you want to visualize the data in excel, use "," as separator instead of "" and save the output file an file.csv
Mike Hassell
Respected Contributor
Solution

Re: converting sar output

Stephen,

I use the 'sar' command to extract the data from the /var/adm/sa/saxx files. Then I use the following awk command to convert them into .csv files, which are easily imported into MS Excel.

awk command:

awk '{for(i=1;i sar_output.csv

If you want to take it a step further you can use perl scripts to import the .csv files and create graphs on the fly and other useful things with excel. I have written some basic perl scripts that use Win32::OLE to import the .csv files, create the graphs I'm after, create nice headers and save them off with the right time and date stamp. I use my workstation for the perl scripts as MS Excel needs to be installed locally for them to work. Shoot me an email if you'd like a copy of the scripts. Hope that helps.

- Mike
The network is the computer, yeah I stole it from Sun, so what?
MANOJ SRIVASTAVA
Honored Contributor

Re: converting sar output

Hi Stephen

There is nice tool at www.sarcheck.com which formats the results in a very nioce report , the software is freee for one month . I am attaching a sample report , may be you like it .


Manoj Srivastava
Matthew Gwin
Occasional Advisor

Re: converting sar output

Mike, can you post (or email) your perl script for sar graphing? It sounds great. Thanks!