sar_commands
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| sar_commands [2015/04/25 09:19] – created luke7858 | sar_commands [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Common Sar Commands ==== | ==== Common Sar Commands ==== | ||
| - | |||
| - | Show **CPU statistics** 3 times with 1 second interval: | ||
| <sxh bash> | <sxh bash> | ||
| - | sar 1 3 | + | sar -u |
| + | sar -q | ||
| + | sar -b | ||
| + | sar -B | ||
| + | sar -d (device) | ||
| + | sar -n DEV | ||
| + | sar -n SOCK | ||
| </ | </ | ||
| \\ | \\ | ||
| - | CPU usage of **all CPUs** (focus on the last field “%idle” to see the cpu load): | + | \\ |
| + | \\ | ||
| + | Show all statistics for current day: | ||
| + | <sxh bash> | ||
| + | sar -< | ||
| + | </ | ||
| + | Show statistics 3 times with 1 second interval | ||
| + | <sxh bash> | ||
| + | sar -< | ||
| + | </ | ||
| + | --------------------------------- | ||
| + | Show **CPU statistics** 3 times with 1 second interval, | ||
| + | <sxh bash> | ||
| + | sar 1 3 | ||
| + | </ | ||
| + | === CPU usage of ALL CPUs === | ||
| <sxh bash> | <sxh bash> | ||
| sar -u 1 3 | sar -u 1 3 | ||
| </ | </ | ||
| - | \\ | + | === Load average === |
| - | Show **CPU** usage for the **current day** | + | |
| <sxh bash> | <sxh bash> | ||
| - | sar -u | + | sar -q |
| </ | </ | ||
| - | \\ | + | ===Swap Space=== |
| - | **Swap Space** show for **current day** | + | |
| <sxh bash> | <sxh bash> | ||
| sar -S | sar -S | ||
| </ | </ | ||
| - | Show swap space for 1 second interval 3 times: | + | \\ |
| + | ==== Viewing specific time and date ==== | ||
| + | Select a specific time during the day: | ||
| <sxh bash> | <sxh bash> | ||
| - | sar -S 1 3 | + | sar -< |
| </ | </ | ||
| - | \\ | + | |
| - | == Viewing specific time and date == | + | |
| <sxh bash> | <sxh bash> | ||
| sar -q -f / | sar -q -f / | ||
| Line 33: | Line 51: | ||
| </ | </ | ||
| \\ | \\ | ||
| - | === Load average | + | === Finding every occurrence the load increased above the recommended amount |
| + | Change the value 4 to the number of CPUs you have | ||
| <sxh bash> | <sxh bash> | ||
| - | sar -q | + | sar -q | awk '$5 > 4' |
| + | </ | ||
| + | \\ | ||
| + | === Summary of logs === | ||
| + | == RAM == | ||
| + | <sxh bash> | ||
| + | for i in $(ls -tr / | ||
| + | </ | ||
| + | == CPU == | ||
| + | <sxh bash> | ||
| + | for i in $(ls -tr / | ||
| + | </ | ||
| + | == load == | ||
| + | <sxh bash> | ||
| + | load=$(grep -ic 'model name' / | ||
| + | </ | ||
| + | <sxh bash> | ||
| + | for i in $(ls -tr / | ||
| + | </ | ||
| + | == Block Device I/O Activities == | ||
| + | <sxh bash> | ||
| + | for i in $( ls -tr / | ||
| </ | </ | ||
sar_commands.1429953554.txt.gz · Last modified: 2024/05/23 07:26 (external edit)
