All Projects → juliojsb → sarviewer

juliojsb / sarviewer

Licence: GPL-3.0 license
Generate graphs with gnuplot or matplotlib (Python) from sar data

Programming Languages

python
139335 projects - #7 most used programming language
Gnuplot
187 projects
shell
77523 projects

Projects that are alternatives of or similar to sarviewer

Tensorflow Plot
📈 TensorFlow + Matplotlib as TF ops
Stars: ✭ 285 (+375%)
Mutual labels:  plot, matplotlib
Itermplot
An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.
Stars: ✭ 1,267 (+2011.67%)
Mutual labels:  plot, matplotlib
Vapeplot
matplotlib extension for vaporwave aesthetics
Stars: ✭ 483 (+705%)
Mutual labels:  plot, matplotlib
matplotlib-haskell
Haskell bindings for Python's Matplotlib
Stars: ✭ 80 (+33.33%)
Mutual labels:  plot, matplotlib
Ttyplot
a realtime plotting utility for terminal/console with data input from stdin
Stars: ✭ 532 (+786.67%)
Mutual labels:  cpu, plot
bitrate-plotter
Plots a graph showing the bitrate every second or the bitrate of every GOP, for a video or audio file.
Stars: ✭ 15 (-75%)
Mutual labels:  plot, matplotlib
Rustplotlib
A Rust's binding of matplotlib
Stars: ✭ 31 (-48.33%)
Mutual labels:  plot, matplotlib
sarbian
We’ve built a plug’n play Operation System (based on Debian Linux) with all the freely and openly available SAR processing software. No knowledge of installation steps needed, just download and get started with SAR data processing. SARbian is free for use in research, education or operational work.
Stars: ✭ 49 (-18.33%)
Mutual labels:  sar, sar-data
smag
Show Me A Graph - Command Line Graphing
Stars: ✭ 78 (+30%)
Mutual labels:  cpu, plot
indicium
Portable, advanced system information utility
Stars: ✭ 46 (-23.33%)
Mutual labels:  cpu, ram
reddit-hot-recorder
Records the activity (comments and karma) on the hot page of a Reddit sub and prepare an animated data visualisation.
Stars: ✭ 89 (+48.33%)
Mutual labels:  plot, matplotlib
Wgcloud
linux运维监控工具,支持系统信息,内存,cpu,温度,磁盘空间及IO,硬盘smart,系统负载,网络流量等监控,API接口,大屏展示,拓扑图,进程监控,端口监控,docker监控,文件防篡改,日志监控,数据可视化,web ssh,堡垒机,指令下发批量执行,linux面板,探针,故障告警
Stars: ✭ 2,669 (+4348.33%)
Mutual labels:  cpu, sysstat
mltb
Machine Learning Tool Box
Stars: ✭ 25 (-58.33%)
Mutual labels:  plot, matplotlib
nodeplotlib
NodeJS plotting library for JavaScript and TypeScript. On top of plotly.js. Inspired by matplotlib.
Stars: ✭ 115 (+91.67%)
Mutual labels:  plot, matplotlib
heatmaps
Better heatmaps in Python
Stars: ✭ 117 (+95%)
Mutual labels:  plot, matplotlib
Adjusttext
A small library for automatically adjustment of text position in matplotlib plots to minimize overlaps.
Stars: ✭ 731 (+1118.33%)
Mutual labels:  plot, matplotlib
Matplotlib4j
Matplotlib for java: A simple graph plot library for java with powerful python matplotlib
Stars: ✭ 107 (+78.33%)
Mutual labels:  plot, matplotlib
Sysstat
Performance monitoring tools for Linux
Stars: ✭ 2,055 (+3325%)
Mutual labels:  cpu, sar
publib
Produce publication-level quality images on top of Matplotlib
Stars: ✭ 34 (-43.33%)
Mutual labels:  plot, matplotlib
gaitutils
Extract and visualize gait data
Stars: ✭ 28 (-53.33%)
Mutual labels:  matplotlib

sarviewer

This repository is intended to give a simple way to measure resources usage (CPU, RAM...) in a machine. It uses sar to retrieve data and gnuplot (by default) or matplotlib to generate graphs from it.

Useful to visualize and analyze data during stress tests.

The following graphs based on sar data are generated:

  • CPU usage
  • Load average
  • RAM usage
  • I/O transfer
  • Processes created per second
  • Swap usage
  • Context switches
  • Tasks (run queue, active, blocked)
  • Network interface statistics (eth0 by default)
  • TCP/UDP sockets

Requirements

For basic functionality you will need to install sysstat and gnuplot in your system using your package manager:

# Debian & based
apt-get install sysstat gnuplot
# RHEL & based
yum install sysstat gnuplot

Minimum version required:

  • gnuplot 4.4+
  • sysstat 10.1.5+

You can check your current version with:

# Gnuplot
gnuplot --version
# Sysstat
sar -V

If your current distribution (for example, CentOS 6) doesn't have these versions in repositories by default, you will have to either install the needed package or build from sources.

If you want to generate the graphs using matplotlib (in Python 2.7) you can install it with pip. In case you don't have pip check the official guide to install it using your chosen package manager. Once you have pip just:

pip install matplotlib
  • If you are going to use the mail option (to send the graphs via email) you will need mutt:
# Debian & based
apt-get install mutt
# RHEL & based
yum install mutt

Usage

  • Clone this repo or download it (ZIP format). Note that the files contained in data/ and graphs/ folders are only for sample purposes.
  • By default the graphs are generated using gnuplot. If you want to generate them using matplotlib, change the variable graph_generator in the file sarviewer.properties from gnuplot to matplotlib
  • Network interface statistics are generated for eth0 by default. Change the variable network_interface as needed in sarviewer.properties file.
  • The repo can be used in two modes, depending on your needs. See below.

Mode 1: Begin collecting data and generate graphs

  • Useful for stress tests. Launch the data_collector.sh script if you want to begin collecting data. Specify the number of samples and interval to take each sample. Notice that whenever you want you can cancel the collector with Ctrl+C, interrumpting the collection of data. If it is cancelled you will need to launch the script plotter.sh manually. The data and graphs generated will overwrite the samples given in this repo in data/ and graphs/ folder respectively.
[jota@myserver sarviewer]$ ./data_collector.sh 
Please specify the number of samples to take-> 10
Please specify the sample interval (take sample every X seconds)-> 2
Taking 10 samples with 2 seconds interval
Total time to collect all data: 20 seconds
----------------------------------
>>> Collecting data
>>> Please wait until data collection is completed
----------------------------------
- You can abort this script with Ctrl+C, but have in mind the data will stop being collected when you cancel it.
- You will also need to manually launch script plotter.sh to generate the graphs.
  • Once the script has finished the data collection or you have cancelled it (and subsequently launched plotter.sh) you can analyze the resource usage in the graphs (PNG format) that have been generated in the graphs/ folder of this repo.

  • You can also use parameters with the script, for example:

# Generate 10 samples with 1 second interval between each one
./data_collector.sh -n 10 -i 1

# Generate 10 samples with 1 second interval between each one and send results to mail
./data_collector.sh -n 10 -i 1 -m [email protected]

Mode 2: Read data from sar daemon and generate graphs

  • If you just want to read the data already generated by sar daemon in your system, use the script system_data_reader.sh and choose the sa* file you want to parse to generate the corresponding graphs. Remember that sar daemon should have been previously enabled in /etc/default/sysstat
[jota@myserver sarviewer]$ ./system_data_reader.sh 
List of sa* files available at this moment to retrieve data from:

-------------------------------------------
File sa15 with data from Linux 3.16.0-4-amd64 (myserver) 	04/15/17 	_x86_64_	(8 CPU)
File sa16 with data from Linux 3.16.0-4-amd64 (myserver) 	04/16/17 	_x86_64_	(8 CPU)
File sa17 with data from Linux 3.16.0-4-amd64 (myserver) 	04/17/17 	_x86_64_	(8 CPU)
File sa18 with data from Linux 3.16.0-4-amd64 (myserver) 	04/18/17 	_x86_64_	(8 CPU)
File sa19 with data from Linux 3.16.0-4-amd64 (myserver) 	04/19/17 	_x86_64_	(8 CPU)
File sa20 with data from Linux 3.16.0-4-amd64 (myserver) 	04/20/17 	_x86_64_	(8 CPU)
File sa21 with data from Linux 3.16.0-4-amd64 (myserver) 	04/21/17 	_x86_64_	(8 CPU)
File sa22 with data from Linux 3.16.0-4-amd64 (myserver) 	04/22/17 	_x86_64_	(8 CPU)
File sa23 with data from Linux 3.16.0-4-amd64 (myserver) 	04/23/17 	_x86_64_	(8 CPU)
-------------------------------------------

Note that the number that follows the "sa" file specifies the day of the data collected by sar daemon
Please select a sa* file from the listed above: sa15
  • You can also use parameters with the script system_data_reader.sh, specifying the sa file to parse, start/ending time and an optional email address where you will receive your graphs attached. Examples:
# Send by email day 04 statistics
./system_data_reader.sh -f sa04 -m [email protected]

# Send by email day 04 statistics between 09:00 and 12:00
./system_data_reader.sh -f sa04 -s 09:00 -e 12:00 -m [email protected]

# Send by email day 05 statistics just since 10:00 
./system_data_reader.sh -f sa05 -s 10:00 -m [email protected]

# Just parse day 05 statistics
./system_data_reader.sh -f sa05
  • Parameters are also useful if you want to send statistics periodically with a crontab. Examples:
# Send graphs statistics from present day everyday at 23:30
30 23 * * * /home/jota/scripts/sarviewer/system_data_reader.sh -f sa$(date +\%d) -m [email protected]

# Send graphs statistics from the day before everyday at 23:30
30 23 * * * /home/jota/scripts/sarviewer/system_data_reader.sh -f sa$(date +\%d -d yesterday) -m [email protected]

GNUPLOT samples

Some samples of graphs generated with gnuplot

  • RAM

Alt text

  • CPU

Alt text

  • Load average

Alt text

  • Processes

Alt text

Matplotlib samples

Some samples of graphs generated with matplotlib (Python)

  • RAM

Alt text

  • CPU

Alt text

  • Load average

Alt text

  • Processes

Alt text

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].