Operating sysstat interactively

assuming you got sysstat installed already

Introduction

to operate interactively, just add interval and count to each command e.g. for those we don’t use as it is about space usage and not about performance

sar -hv 1 10
sar -hF 1 10

the following examples assume you’ve already got stats available in there

ls -alF /var/log/sa/

Usage

sar -V

monitor cpu activity real-time (incl i/o) with interval 1 sec and count 10

sar -hu

load / process count

sar -hq
sar -hw

ram / paging / swap

sar -hr
sar -hB
sar -hS

i/o

sar -hd
sar -hb

network per NIC

sar -n EDEV --iface=xenbr0

Performance graphs

switch to sar command line options by specifying --

vi ~/sysstat-graphs.bash

#!/bin/bash

mkdir -p /var/www/html/sysstat/
cd /var/www/html/sysstat/
sadf -g -s 00:00:00 -e 23:59:59 -T -- -u > cpu.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -q > load.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -w > processes.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -r > ram.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -B > paging.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -S > swap.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -d > io.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -b > io2.svg
sadf -g -s 00:00:00 -e 23:59:59 -T -- -n EDEV --iface=xenbr0 > network.svg

chmod +x ~/sysstat-graphs.bash

Resources

SAR command in Linux to monitor system performance https://www.geeksforgeeks.org/sar-command-linux-monitor-system-performance/

Network Monitoring using SAR https://medium.com/@malith.jayasinghe/network-monitoring-using-sar-37bab6ce9f68

graphs

System Monitoring with Sar https://tomfern.com/posts/sar-guide


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun