linux, windows
CentOS - CPU 점유율이 80% 이상일때
디츠
2015. 6. 19. 15:15
#!/bin/bash
result=$(top -b -n 2 |grep Cpu |tail -n 1 |awk '{print $2}' |sed 's/.[^.]*$//')
if [ $result -gt 80 ] then
// 명령어
else
// 명령어
fi