ksar icon indicating copy to clipboard operation
ksar copied to clipboard

command line feature for generating reports in PNG and PDF

Open marta-lapina opened this issue 8 years ago • 10 comments

I am trying out run kSar from commandline in a Jenkins job. I wish to produce PDF graphs from sar reports without using GUI manually. I am running sar with the following command:

java -jar /opt/ksar/ksar-5.2.2-all.jar -input "${WORKSPACE}/report.txt" -outputPDF ${BUILD_NUMBER}-${ENVIRONMENT}/${ENVIRONMENT}${day}.${d}${formatstarttime}-${formatendtime}.pdf

Instead of generating a PDF, the process is running, but produces no output. I just cancel it manually without obtaining the PDF that I need. How to run ksar from commandline to generate PDF with graphs?

marta-lapina avatar Mar 09 '17 18:03 marta-lapina

i never tried the commandline. did you successfully open the sar file with the GUI? usually when ksar is not progressing its a datetime format issue.

I don't see a DateTimeFormat specified in your cmdline.

Pitterling avatar Mar 09 '17 21:03 Pitterling

@marta-lapina is this issue is still valid? Please provide an update, otherwise i will close it. Thx

Pitterling avatar Apr 18 '17 08:04 Pitterling

I found out that after v5.0.6 kSar it's not possible to run kSar without it's UI to generate reports. You can close the ticket.

marta-lapina avatar Apr 24 '17 04:04 marta-lapina

please have a look to #95

Pitterling avatar Jun 14 '17 18:06 Pitterling

I know it's a year old thread but just would like to say that I notice that same issue with 5.2.4. I run the same shell command line and it won't produce any pdf output. It just launches the GUI with the file being loaded. When I try to export it to pdf, java issues runtime error

Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
	at net.atomique.ksar.ui.DataView.PDFMenuActionPerformed(DataView.java:291)

I can export the same file to PDF without any issue if I just run the GUI manually (without those input/output paramaters) and export it with menu option. It seems that command line parameter interferes with export process.

kmoec avatar Feb 01 '18 18:02 kmoec

Yeah, that's still an open issue .. see also #122

Currently we have 2 PRs open to address this .... #95 and #117

might look into this in the next weeks.

Pitterling avatar Feb 01 '18 23:02 Pitterling

Would it be possible to get the source code of 5.0.6?

kmoec avatar Feb 08 '18 21:02 kmoec

sourceforge holds only the 5.1beta code base. This fork here is based on this. Unfortunately we don't have access to 5.0.6 source code.

There is another fork which has worked on the PDF export already https://github.com/ppalucha/ksar2/. I never tried ..

Pitterling avatar Feb 08 '18 23:02 Pitterling