°Ô½Ã¹° 42°Ç
   
[½ºÅ©¸³Æ®] RedHat OS Á¡°ËÀ¯Áöº¸¼ö ½ºÅ©¸³Æ®
±Û¾´ÀÌ : theko ³¯Â¥ : 2014-02-28 (±Ý) 18:01 Á¶È¸ : 8659

// OS Á¡°Ë½Ã »ç¿ëÇÑ ½ºÅ©¸³Æ® //

#!/bin/sh

todaytime=`date +%F[%X]`

today=`date +%F`

HOST=`hostname`


rm -rf $today[$HOST].txt

echo " ########## $HOST SYSTEM CHECK $todaytime ##########" >> $today[$HOST].txt

echo "[1] Hostname :" $HOST  >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# uname -a" >> $today[$HOST].txt
uname -a  >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# cpuinfo " >> $today[$HOST].txt
cat /proc/cpuinfo | grep name >> $today[$HOST].txt
cat /proc/cpuinfo | grep MHz >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# OS release" >> $today[$HOST].txt
echo "# cat /etc/*-release" >> $today[$HOST].txt
cat /etc/*-release >> $today[$HOST].txt
echo "# cat /etc/issue" >> $today[$HOST].txt
cat /etc/issue >> $today[$HOST].txt
echo "*************************************************************************" >> $today[$HOST].txt
echo "[2] Network info :" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# ipconfig" >> $today[$HOST].txt
ifconfig >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# netstat -an " >> $today[$HOST].txt
netstat -an >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# netstat -nr " >> $today[$HOST].txt
netstat -nr >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# ethtool eth0" >> $today[$HOST].txt
ethtool eth0 >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# date" >> $today[$HOST].txt
date >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# uptime" >> $today[$HOST].txt
uptime >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# ntpq -p" >> $today[$HOST].txt
ntpq -p >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "*************************************************************************" >> $today[$HOST].txt
echo "[3] Memory info :" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# free" >> $today[$HOST].txt
free >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# vmstat" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
vmstat 1 5 >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "*************************************************************************" >> $today[$HOST].txt
echo "[4] Volume info :" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# df -h / vgdisplay / lvdisplay" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
df -hP >> $today[$HOST].txt
vgdisplay >> $today[$HOST].txt
lvdisplay >> $today[$HOST].txt
echo "*************************************************************************" >> $today[$HOST].txt
echo "[5] Log info  :" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# dmesg" >> $today[$HOST].txt
dmesg | grep -i -e fail -e error -e warning -e stop >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# Messages" >> $today[$HOST].txt
cat /var/log/messages | grep -i -e fail -e error -e warning -e stop >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# lastlog" >> $today[$HOST].txt
lastlog >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# w" >> $today[$HOST].txt
w >> $today[$HOST].txt
echo "*************************************************************************" >> $today[$HOST].txt
echo "[6] Service info  :" >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# chkconfig --list " >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# Chkonfig --list " >> $today[$HOST].txt
chkconfig --list >> $today[$HOST].txt
echo " " >> $today[$HOST].txt
echo "# ps -ef " >> $today[$HOST].txt
ps -ef >> $today[$HOST].txt


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com