0

sar takes a lot of numeric measurements at regular intervals.

I have sar data files for covering a week, and I want to generate a report. Currently I copy/paste and concatenate data for each day into a spreadsheet and create line charts, then copy these charts into a document and generate a PDF, all of which is very time-consuming.

Is there a tool that can do all of this automatically?

Requirements:

  • Output can be PDF, HTML, or office formats such as LibreOffice or Word.
  • No tables of numbers, only line charts.
  • Each line charts must show all days. Not a separate chart for each day.
  • Free

Ideally:

  • Let me enter an "anomaly time", and put a red vertical bar at that exact time in the background of each chart.
  • Adapt scale to the numbers
  • Show a "reference period" in grey in the background of each chart. When investigating on a anomaly, it is useful to compare with what the lines looked like the week before the anomaly.
  • Open source
  • For tables with extra dimensions (CPU and network links), give the option to not include per-CPU charts. Also give the option to not show information about variables that have not changed at all during the period.
  • There are lots of python plotting libraries for this sort of thing that can meet all of your requirements. – Steve Barnes Apr 13 '18 at 10:46
  • @SteveBarnes: Really? I am looking for a tool to which I would give the sar files, and which would give me the output, without any coding needed. sar files are rather complex, containing many tables of data, some with their own peculiarities, the tool has to know how to parse that. – Nicolas Raoul Apr 13 '18 at 11:44
1

One possibility, with no more coding than deciding which outputs you wish to visualize, is the python SAR Vizualisation Tool python-sarviz.

The code (from the web site linked):

from sar import parser
from sar import viz

insar = parser.Parser('./data/sample.log')
sar_viz = viz.Visualization(insar.get_sar_info(), paging=True, network=True, disk=True)
sar_viz.save('sample.pdf')

Will produce a pdf with content such as (from the web site linked): enter image description here

  • With a very little coding you should be able to produce daily summaries rather than single points for each data event.
  • Currently output is pdf or png format.
  • Just the graphs are output
  • Gratis & Open Source
  • Minimal coding
  • Auto-scales the graphs
  • Modification to include previous data as an underlay should be reasonably simple
  • Addition of an anomaly time marker would be trivial.
  • Looks great! I will try it :-) As sar can is often configured to record (or not) various metrics, I wish the tool could just output everything found in the file, though, rather than only output what it is told to. – Nicolas Raoul Apr 14 '18 at 4:13
  • @NicolasRaoul From a quick look at the code it should be relatively simple to add this as an option, (at least for the not too obscure data structures). – Steve Barnes Apr 14 '18 at 5:15
  • The tool crashes for me: github.com/milinda/python-sarviz/issues/2 Also, it does not seem to allow me to specify several days, as it only takes one file (=one day) as an argument. – Nicolas Raoul Apr 16 '18 at 10:32
  • @NicolasRaoul First well done for raising a ticket - it looks like you might be trying to plot a data set that the parsing didn't manage to find any of. The several days would take either concatenating the files into a single one or modifying the code to take several and parse them all. – Steve Barnes Apr 16 '18 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.