I'm currently writing a cronjob around kSar
's command line (non-GUI) options in order generate PDF's. I'm just going to email a PDF of the previous day's activity to a different webmaster (basically just a power user) every day after midnight.
This is the command I'm trying to use:
java -jar /usr/local/ksar/kSar.jar -cpuFixedAxis \
-input /var/log/sa/sa$(date +"%d" -d yesterday) \
-outputPDF /tmp/SAR-$(date +"%d-%m-%Y" -d yesterday).pdf
The above properly generates a PDF document and I can email it to whomever I want.
Problem is that there's a lot more information on there than I really think he needs and I really see him getting confused and either asking me to help him understand it or just disregarding the email and pinging me personally whenever he has a question about load or performance (which will be a lot).
I'm seeing that kSar has a -graph
option for generating only a certain subset of graphs, but I have no idea how to use it, and it's not online anywhere. -help
says to feed it a list of the graphs I want to generate but there's no indication of how I'm supposed to figure out what each graph is technically called. I thought -showOnlygraphName
was my savior, but that just popped up the regular non-PDF GUI for the relevant SAR and it looks identical to if I had left -showOnlygraphName
to begin with.
At this point I'm grasping at straws so any help would be appreciated.
EDIT:
Just so you you can see the syntax I'm using when I say in the comments that I've tried the graph names @derobert suggested:
$ java -jar kSar.jar -graph SWAP -input sar31 -outputPDF out.pdf
time to parse: 695ms number of line: 4073 line/msec: 5.0
jadavis@XXX-R9ZN2ZV /cygdrive/c/Documents and Settings/JADAVIS/Documents/kSar-5.0.6
$ echo $?
0
jadavis@XXX-R9ZN2ZV /cygdrive/c/Documents and Settings/JADAVIS/Documents/kSar-5.0.6
$ ls out.pdf
ls: cannot access out.pdf: No such file or directory
$ java -jar kSar.jar -graph LOAD -input sar31 -outputPDF out.pdf ; ls out.pdf
time to parse: 681ms number of line: 4073 line/msec: 5.0
ls: cannot access out.pdf: No such file or directory
What's directly above is being done in cygwin
, but the syntax works (i.e generates PDF output) if I just don't try to restrict which graphs to generate. I've also tried a variety of casings and quotation styles.
EDIT #2:
Partial success in this area. I found this page and following its instructions I was able to generate a PDF that only had CPU activity in it:
jadavis@XXX-R9ZN2ZV /cygdrive/c/Documents and Settings/JADAVIS/Documents/kSa r-5.0.6
$ java -jar kSar.jar -input sar31 -outputPDF out.pdf -graph all-cpu; ls -l out.pdf time to parse: 712ms number of line: 4073 line/msec: 5.0
-rwx------+ 1 jadavis mkpasswd 112772 Apr 3 18:51 out.pdf
Best Answer
Here's the list of -graph options available in kSar v5.0.6 -
Here's an example of how I generate a report -