|
1 day ago | |
---|---|---|
src | 6 months ago | |
.gitignore | 6 months ago | |
LICENSE | 1 year ago | |
README.md | 1 day ago | |
atopsar_plot.py | 1 day ago | |
setup.py | 9 months ago |
README.md
Atopsar-Plot
Graphically represent the historical system resource consumption like CPU, disk, memory and network usage in a terminal.
Features
Atopsar-Plot allows graphing various historic system information directly in the terminal. It is based on logs written by atop. The following information can be plotted:
- %CPU_busy: CPU busy time in percent. Multiple cores are averaged to 100%
- %DSK_busy: Disk activity in percent (see --disk flag)
- %MEM_used: Used memory in percent ((memtotal - memfree - buffers - cached) / memtotal * 100)
- %NET_busy: Network usage in percent. Formula: max(imbps, ombps) / maxmbps_if_ (see --iface flag)
Plots for previous days can be plotted with the parameter --day -1, --day -2, ... or with alternative format YYYY-MM-DD
Resource usage alerts
Resource usage alerts can be sent by specifying an --alert-mail. For this to work, the package mailx must be installed and configured to allow sending mails. You may create a cron job for alerts. Keep in mind that atop averages resource consumption over the whole time granularity (default is 10 minutes). With the default --alert-threshold (70) an alert will be generated if any of the monitored resources exceeds 70% of its maximum capacity.
Additionally, there is a hard disk space allocation alert for the root filesystem "/" whose threshold can be set with --alert-disk-threshold.
# crontab -e
*/10 * * * * /path/to/atopsar-plot --alert-mail alert@example.com
Installing
Install atop
Download and install atop and netatop on a debian based system
sudo apt install zlib1g-dev zlib1g libncurses5-dev
wget https://www.atoptool.nl/download/netatop-3.1.tar.gz
tar -xzf netatop*.gz
cd netatop*/
make -j4
sudo make install
sudo systemctl enable --now netatop
cd ..
wget https://www.atoptool.nl/download/atop-2.8.1.tar.gz
tar -xzf atop*.gz
cd atop*/
make -j4
sudo make install
sudo systemctl enable --now atop
sudo systemctl enable --now atop-rotate.timer
Install atopsar-plot and PIP dependencies
pip install -U git+https://codeberg.org/mgellner/atopsar-plot
Contributing
When contributing to this repository, please first discuss the change you wish to make via issue
License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details