Sunday, June 29, 2014

Automation – Monthly SAR report using KSAR

If you are an System/Database administrator, and just like me you also want to generate the monthly SAR report in graphical form for analyze the trend. Then this article is definitely for you, please follow the steps mentioned below.

image

Step 1: -

Merge all the SAR output available in the /var/log/sa*.

#!/bin/bash

#Program Name:gather_sar.sh

merge_sar()

{

#loop through 31 possible days, merge all files into one

for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do

LC_ALL=C sar -A -f /var/log/sa/sa$i >> sarmonthly.txt

done

}

#Main function starts here

merge_sar

Step 2:-

Pass the merged text filed as an input to this kSar.jar, like below:

[thiru@localhost kSar-5.0.6]$ java -jar kSar.jar  -input sarmonthly.txt -outputPDF sarmonthly.pdf

time to parse: 1022ms number of line: 4357 line/msec: 4.0

Step 3:- Memory utilization of this machine for the last one week.

image

No comments:

Post a Comment