Monday, June 8, 2009

ksar: a sar grapher: usage

If you are the first time user of kSar, you can unzip it and start it in Linux by

# unzip kSar-5.0.6.zip
# cd kSar-5.0.6
# sh run.sh

It should able to start the GUI if the java is in your path. If it is not, you can set $JAVA_HOME first. E.g.:

# export JAVA_HOME=/usr/java/jdk1.5.0_08
# sh run.sh

And then you can try everything in the GUI.

But if you are a heavy user of kSar like me, you should learn this:

# sh run.sh -input /var/log/sa/sar13

And there are many others useful command line argument. You should have a look to them by:

# sh run.sh -help

Tuesday, June 2, 2009

ksar: a sar grapher

I use kSar for more then a year in my daily Linux support life. It is really useful (and saved my life for several times). But I haven't see much articles on web that talk about it. So I would like to write a simple introduction by myself.


kSar is a Java-based standalone application, which can read and graph the "sar" file generated by sar from Solaris, Linux, AIX and HP-UX system. Here are some advantage of kSar:

1. Multiple Platform
Because it is Java-based, it can run on many platforms (include Windows, but I have not tested). It is useful for me because I can study the sar files from whatever OS/platfrom on the platform I am using.

2. Dynamic graph + PDF export
It makes use of jfreechart library such that we can zoom-in the graph, while it can also output the graph in pdf, jpg, png and even csv format. It is useful for me to generate reports to customers. Moreover, you can add background (e.g. company logo) in the output graph.

3. Some useful extensions
It is open-source. And I have added several patch to add some common extended statistics on Linux system like "memused with buffer adjusted", stacked memory graph and system restarted marker (add in ksar-5.0.7).

4. Real time statistics
Other then reading existing sar file, it can get the output from command line or ssh command to display real time statistics.

5. Compare two graph
It can load two sar files and view it together for easy comparison, also you can compare two graph in the sar file.


I will talk about the usage of kSar soon.