#!/bin/sh
FILELOG=/tmp/System_Check_$(hostname)_$(date +%Y-%m-%d).log
echo $(date +%Y-%m-%d) >$FILELOG
echo "==System Hardware Check===dmesg===" >>$FILELOG
dmesg >>$FILELOG
echo "">>$FILELOG
echo "==System Up Times===uptime===" >>$FILELOG
uptime >>$FILELOG
echo "">>$FILELOG
echo "==File System Used===bdf===" >>$FILELOG
bdf >>$FILELOG
echo "">>$FILELOG
echo "==VG Information===vgdisplay===" >>$FILELOG
vgdisplay >>$FILELOG
echo "">>$FILELOG
echo "==Hardware Information===machinfo===" >>$FILELOG
machinfo >>$FILELOG
echo "">>$FILELOG
echo "==Swap Information===swapinfo===" >>$FILELOG
swapinfo >>$FILELOG
echo "">>$FILELOG
echo "==Memory Information===vmstat===" >>$FILELOG
vmstat 1 10 >>$FILELOG
echo "">>$FILELOG
echo "==IO Information===iostat===" >>$FILELOG
iostat 1 10 >>$FILELOG
echo "">>$FILELOG
echo "==CPU Information===sar===" >>$FILELOG
sar -u 1 10 >>$FILELOG
echo "">>$FILELOG
echo "==Core File Clear===find rm===" >>$FILELOG
find / -name core -print -exec rm {} \; 1>>$FILELOG 2>>$FILELOG
echo "">>$FILELOG
echo "==Crontab Check===crontal===" >>$FILELOG
crontab -l >> $FILELOG
echo "">>$FILELOG
阅读(765) | 评论(0) | 转发(0) |