SAR Cheatsheet

Published: 2018-04-19 18:03:02 +0000
Categories: Misc,




sar can be an incredibly helpful utility when examining system performance (especially after the fact), but if not used regularly it's easy to forget which flags to use

This short post details a number of useful arguments to pass

Based On


# Basic Output

# CPU Usage per Core
sar -P ALL

# Memory Usage
sar -r

# Swap Usage
sar -S

# I/O
sar -b

# I/O by Block Device
sar -d -p

# Check Run Queue and Load Average
sar -q

# Network Stats
sar -n DEV

# Where DEV can be one of the following
# DEV â Displays network devices vital statistics for eth0, eth1, etc.,
# EDEV â Display network device failure statistics
# NFS â Displays NFS client activities
# NFSD â Displays NFS server activities
# SOCK â Displays sockets in use for IPv4
# IP â Displays IPv4 network traffic
# EIP â Displays IPv4 network errors
# ICMP â Displays ICMPv4 network traffic
# EICMP â Displays ICMPv4 network errors
# TCP â Displays TCPv4 network traffic
# ETCP â Displays TCPv4 network errors
# UDP â Displays UDPv4 network traffic
# SOCK6, IP6, EIP6, ICMP6, UDP6 are for IPv6
# ALL â This displays all of the above information. The output will be very long.

# Historic Information
# By default, sar will output for the previous 24 hours, 
# however previous days can be checked with
sar -f /var/log/sa/sa15 -n DE

Usage Example

# Check Memory usage for yesterday
sar -f /var/log/sa/sa`date --date='-1 day' +'%d'` -r


SAR, cheatsheet, sysstat, system performance, system resources, monitoring, historic,

Latest Posts

Remotely backing up PFsense Configuration (BASH)
FFMPEG: Converting RMVB to X264 MP4 (BASH)
Recursively print table (print_r equivalent) (LUA)
Bulk Delete Comments from (Self-Hosted) JIRA Issues (Misc)
Add a static entry to the ARP table (BASH)
SSL Cipher Hex codes to Human Readable Names (Misc)
Convert Ascii to Binary (BASH)
Intercepting Outbound DNS Queries (BASH)
Handle Google Verification files within NGinx Configuration (NGinx)
Getting WhatsApp Rich Snippet Previews Working (Misc)

Copyright © 2018 Ben Tasker | Sitemap | Privacy Policy
Available at and snippets.6zdgh5a5e6zpchdz.onion