Python SAR (sysstat) parsing module (pre) released

And now something completely different and as unexpected as the Spanish inquisition! Another release of Python module to PyPi and GitHub.

This time it’s a SAR (sysstat service) log file parser. If you are a UNIX/linux sysadmin and not sure what SAR is, head on here, and here for introduction on the subject.

Internally, we are actively using this module within our company for monthly reports on RHEL servers we maintain under the contract. When opensourced, the module already introduced some advances from the codebase we were using, namely:

  • it has been updated to work properly with other SAR log files than just RHEL’s own (tested with Fedora 19 and Debian 7 so far, users of other distributions are welcome to contribute their experience and/or code),
  • it now also handles AM/PM time formats well, compared to supporting only 24-hour format which is RHEL default on RHEL 5 and 6. By “handle” I mean to say that times are converted to 24-hour formats.

And as it should be expected from the module released with 0.2 version tag, if has its own shortcomings we are aware of:

  • module does not collect all of the data from SAR log files. It collects only the data we are using in our monthly reports. This will be changed in the future versions. For now, you will get from it the basic information concerning CPU usage, memory and swap file(s) usage and basic I/O performance.
  • in the future we will probably implement reducing the default dictionary output to slightly less memory consuming timestamped list. Default behaviour of the module is unlikey to change though, reduce function will be an option which users will be able to use in order to make data processing tasks more simple.
  • module contains inline documentation, but it’s far from perfect. We will document it more thoroughly in the future releases.
  • we plan to soon release another module from our production, which you’ll be able to use combined with this current module in order to get quick graphs from your SAR log files.

As I’ve indirectly mentioned above, module works in a way that it parses out information from SAR log files into the dictionary. For dictionary format please check output of the script included in the github repository.

Besides basic Parser functionality, module also brings along Multiparser class which is used to parse “combined” SAR log files. Again, for now please consult script for the details.

Published by Vedran Krivokuca

A developer living and working in Germany. Wannabe opensource contributor. Feeling strong of some social issues.

Join the Conversation


Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This site uses cookies. Find out more about this site’s cookies. Dismiss