개발자는 오늘도 달립니다.
[리눅스] Linux 각종 성능 수집 명령어 모음 본문
# Network Inbound / Outbound
cat /proc/net/dev | grep $ETH_TYPE | cut -f2 -d: | awk '{print $1, $9}'`
# CPU value
cat /proc/stat | grep -e '^cpu ' | grep -v grep | awk '{print $0}' > cpudata
# Load Average
cat /proc/loadavg | awk '{print $1}'
# IO read / write
df . | grep '/' | awk '{print $1}' | cut -d'/' -f3-
iostat $home -d 1 1 | grep $home | awk '{print $3, $4}'
# Free / Swap memory
totalMemory=`cat /proc/meminfo | grep MemFree | awk '{print $2$3}'`
swapMemory=`cat /proc/meminfo | grep SwapFree | awk '{print $2$3}'`
# Linux Version
cat /proc/version
# Redhat Version
redhatVersion=`cat /etc/redhat-release`
echo $redhatVersion
#CentOS Version
cat /etc/issue
# Memory Total Size
cat /proc/meminfo | grep MemTotal | awk '{print $2$3}'
# CPU model
cat /proc/cpuinfo | grep 'model name' | head -n 1
# CPU Number
cat /proc/cpuinfo | grep processor | wc -l
# Disk Information
df=`df -h | grep -v grep `
echo -n "$df"
# Hardware Device
dmidecode | grep Name