User Tools

Site Tools


sar_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sar_commands [2016/04/29 07:23] luke7858sar_commands [2024/05/23 07:26] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ==== Common Sar Commands ==== ==== Common Sar Commands ====
 +<sxh bash>
 +sar -u 
 +sar -q
 +sar -b
 +sar -B
 +sar -d (device)
 +sar -n DEV
 +sar -n SOCK
 +</sxh>
 +\\
 +\\
 +\\
 Show all statistics for current day: Show all statistics for current day:
 <sxh bash> <sxh bash>
Line 44: Line 56:
 sar -q | awk '$5 > 4' sar -q | awk '$5 > 4'
 </sxh> </sxh>
 +\\
 === Summary of logs === === Summary of logs ===
 == RAM == == RAM ==
 <sxh bash> <sxh bash>
-for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -r -f $i | awk '$4 > 98.8'; done+for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -r -f $i | awk '$4 > 98.8'; done | awk '!/Average|Linux/'
 </sxh> </sxh>
 == CPU == == CPU ==
 <sxh bash> <sxh bash>
-for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -u -f $i | awk '$8 > 20'; done+for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -u -f $i | awk '$8 > 20'; done | awk '!/Average|Linux/'
 </sxh> </sxh>
 == load == == load ==
 <sxh bash> <sxh bash>
-for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -q -f $i | awk '$5 > 1'; done+load=$(grep -ic 'model name' /proc/cpuinfo ); for i in $(ls -1tr /var/log/sa/sa[0-3]*| grep -v '.bz2'); do echo "$(stat --printf='%.16y...' $i)"; sar -q -f $i | awk ' $6 > '"$load"' {print $0}' | grep -v 'Average\|x86'; echo ''; done 
 +</sxh> 
 +<sxh bash> 
 +for i in $(ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i); sar -q -f $i | awk '$5 > 1'; done | awk '!/Average|Linux/' 
 +</sxh> 
 +== Block Device I/O Activities == 
 +<sxh bash> 
 +for i in $( ls -tr /var/log/sa/sa[0-9][0-9]); do echo $(ls -l $i ); sar -p -d | awk '$11 > 80'; done | awk '!/Average|Linux/'
 </sxh> </sxh>
sar_commands.1461914581.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki