#"!"/bin/bash
#jin-hyo, yun (2018.08.14)
tmp_fn="temp.tmp"
clear
echo
echo "========================================================="
echo " System Check Automation (Create by YJH, 2018/08/14) "
echo "---------------------------------------------------------"
os_ver=`grep . /etc/*centos-release |perl -ane print`
chk_time=`date`
echo " OS Ver : " $os_ver
echo " DB Ver : MariaDB 10.1.26"
echo " Check : " $chk_time
echo "========================================================="
cpu_stat=`sar 1 3 |grep Average |perl -ane 'printf "$F[2]%"'`
mem_stat=`free -h |grep Mem |perl -ane 'printf "$F[2]/$F[1]"'`
swap_stat=`free -h |grep Swap |perl -ane 'printf "$F[2]/$F[1]"'`
echo
echo "+--------------------------------------------------------+"
echo "| 1. System Cehck (CPU, Memory, Swap) |"
echo "+--------------------------------------------------------+"
echo " CPU : " $cpu_stat
echo " MEMORY : " $mem_stat
echo " SWAP : " $swap_stat
ps_sshd=`ps -ef |grep -v grep |perl -ne 'printf 0 < $. if /sshd$/'`
ps_crond=`ps -ef |grep -v grep |perl -ne 'printf 0 < $. if /crond$/'`
echo
echo "+--------------------------------------------------------+"
echo "| 2. File system Usage |"
echo "---------------------------------------------------------+"
df -h | awk 'NR == 1; NR > 1 {print $0 | "sort -k6"}'
disk_stat=`smartctl -H /dev/sda1 |grep 'SMART Health Status' |perl -ane 'printf "$F[3]"'`
echo
echo "+--------------------------------------------------------+"
echo "| 3. Disk Health Status |"
echo "+--------------------------------------------------------+"
echo " SMART Health Status : " $disk_stat
echo
sys_boot=`who -b | perl -ane print`
echo "+--------------------------------------------------------+"
echo "| 4. System Boot |"
echo "+--------------------------------------------------------+"
echo "" $sys_boot
uptime
echo
echo "+--------------------------------------------------------+"
echo "| 5. Current login User |"
echo "+--------------------------------------------------------+"
who -u
echo
echo "-------------------- ( End of Check ) --------------------"
echo
cat /dev/null > $tmp_fn
'IT > Linux, Unix' 카테고리의 다른 글
리눅스(linux) 쉘(bash) 명령어 인덱스 (0) | 2021.09.10 |
---|---|
Unix/Linux 사용용도에 따른 주요 명령어(command) (0) | 2021.09.10 |
리눅스 종료 및 재부팅 명령어 (0) | 2021.06.11 |
접속자 강제 종료 방법 (0) | 2021.03.26 |
linux 파티션 디렉토리 용량 확인방법 전체 폴더 크기 사이즈 (0) | 2021.03.26 |