/sarcharts

Graph data available in a sar file, from systat Linux/Unix package.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

SAR Charts

SAR Charts is a web interface to display the data, provided by SAR (System Activity Report, from sysstat package) on Linux and Unix servers, with charts.

Freely inspired from https://sarchart.dotsuresh.com/. Many thanks to SĂ©bastien Godard for creating and maintaining sysstat : https://github.com/sysstat/sysstat.

As i am not a developer, there is much room for improvments in the code.

Demo

You can see and test a demo at https://sarcharts.tuxfamily.org, thanks to the TuxFamily folks :)

Dependencies

SAR compatibility

The only broken thing you will see, if you use a sar file from a more recent sysstat package than i have tested and implemented, is some graphs with "undefined" as a title or data not graphed. I have tested SAR Charts with these OS and sysstat versions :

  • AIX 6.1
  • CentOS 6.0 to 7.9
  • RHEL 3.1 to 7.9
  • SLES 11
  • Solaris 5.8 to 5.11
  • Ubuntu 12.04 to 20.04
  • Sysstat 5.0.5 to 12.2.0

How it works ?

SAR exported text file parsing is done by parseSA.php and config.php. Each SAR data block is named with it's first data column name and classed into a category, according to config.php. As we can have some duplicates in the columns names, the code do some renaming in known cases. config help structuring the data, and can restrict data when we are in a block with multiple lines with the same hour (e.g.: the CPU main block with a line for each core - and one for all of them - for each time entry).

Then, the object is grabbed in json format by the main.min.js file which displays the graphs, grouped by categories (as the exception of the "Resume" category, which i define in the javascript).

Configuration

You need a webserver with PHP enabled (works with 5.5 and superior) to serve this web interface. uploads folder needs to be writable by the web server user.

License

SAR Charts is available under the GNU GPL v3 license.