°Ô½Ã¹° 42°Ç
   
[½ºÅ©¸³Æ®] ¼­¹öº° ½Ã°£ º¸±â
±Û¾´ÀÌ : theko ³¯Â¥ : 2011-10-06 (¸ñ) 14:32 Á¶È¸ : 1602



#!/bin/sh

HTML=/home/theko/apache/htdocs/time/index.html


echo "<font size="5" color="blue"> Development Server Time</font>" > $HTML
echo "<TABLE width="100%" height="" border="1" bordercolor="blue"  cellspacing="1" cellpadding="0">" >> $HTML
echo "<TR>" >> $HTML


for HOST in `grep 1.1.1.1 /etc/hosts  | awk '{print $1}'`
do
        echo "<TR>" >> $HTML
        echo "<TD>" >> $HTML
        ssh $HOST "hostname" >> $HTML
        echo "</TD>" >> $HTML
        echo "<TD>" >> $HTML
        ssh $HOST "date"  >> $HTML
        echo "</TD>" >> $HTML
        echo "<TD>" >> $HTML
        ssh $HOST "uptime"  >> $HTML
        echo "</TD>" >> $HTML
        echo "</TR>" >> $HTML
        done

 

echo "</TR>" >> $HTML
echo "</TABLE>" >> $HTML


theko 2011-11-11 (±Ý) 15:40

#!/bin/sh

HTML=/home/theko/apache/htdocs/time/index.html


echo "<font size="5" color="blue"> Development Server Time</font>" > $HTML
echo "<TABLE border="8">" >> $HTML
echo "<TR>" >> $HTML
echo "<TH>hostname</TH>" >> $HTML
echo "<TH width="120">IP</TH>" >> $HTML
echo "<TH width="200">DATE</TH>" >> $HTML
echo "<TH>UPTIME</TH>" >> $HTML
echo "<TH>OS Version</TH>" >> $HTML
echo "</TR>" >> $HTML


for HOST in `grep 1.1.1.1 /etc/hosts  | awk '{print $1}' `
do
        echo "<TR>" >> $HTML
        echo "<TD>" >> $HTML
        ssh $HOST "hostname" >> $HTML
        echo "</TD>" >> $HTML

        echo "<TD>" >> $HTML
        echo "$HOST" >> $HTML
        echo "</TD>" >> $HTML

        echo "<TD>" >> $HTML
        ssh $HOST "date > /root/date"
        ssh $HOST ""echo" | "cat /root/date |  awk '{print $1,$2,$3,$4}'"" >> $HTML
        echo "</TD>" >> $HTML

        echo "<TD>" >> $HTML
        ssh $HOST "uptime > /root/uptime " >> $HTML
        ssh $HOST ""echo" | "cat /root/uptime | awk '{print $3,$4,$9,$10,$11,$12}'"" >> $HTML
        echo "</TD>" >> $HTML

        echo "<TD>" >> $HTML
        ssh $HOST ""echo" | "cat /etc/issue | awk '{print $3,$4,$5}'| grep -v Kernel"" >> $HTML
        echo "</TD>" >> $HTML
        echo "</TR>" >> $HTML


        done


echo "</TABLE>" >> $HTML

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

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