Operating sysstat interactively

sysstat sysstat-ops sysstat-graph

assuming you got sysstat installed already

Usage

interactively

to get a single shot, use zero interval e.g.

sar -hu 0

to monitor resource real-time, just specify interval and count to each command e.g.

sar -hu 1 3

stored system stats

assuming you’ve already got stats available in there

ls -alF /var/log/sa/

without additional args e.g.

sar -hu

Resource types

monitor cpu activity (incl i/o)

sar -hu 0

load / process count

sar -hq 0
sar -hw 0

ram / paging / swap

sar -hr 0
sar -hB 0
sar -hS 0

i/o

sar -hd 0
sar -hb 0

network stats per NIC

sar -n DEV --iface=xenbr0 0

network errors per NIC

sar -n EDEV --iface=xenbr0 0

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