|
|
|
¸®´ª½ºÆÁ Go Unix Power Tools Online Book
Go Bash Guide
|
|
Read No. 140 article |
2002-04-29 03:20:43 |
|
|
|
|
NickName |
Ç®ºñ´© |
Subject |
httpd Æ®·¡ÇÈ ºÐ¼® ¹× ´ëó |
|
|
¾ÆÆÄÄ¡¿¡ ±âº» Á¦°øµÇ´Â server-status Ç׸ñÀ» on ½ÃÄÑ¾ß ºÐ¼®ÀÌ °¡´É
ÇÕ´Ï´Ù.
# cat traffic
++++++++++++++++++++++++++++++++++
#!/bin/bash
# ÀÔ¸À¿¡ ¸À°Ô ¼öÁ¤
limit=10
refer="http://www.byus.net/server-status"
mailaddr="sontina at chollian.net"
# httpd network traffic
speed=$(lynx -nolist -verbose -dump http://www.byus.net/server-
status|head -n15|grep "requests/sec"|awk '{print $4}')
echo "Current Httpd Network Traffic : $speed"
# interger transfer
speed=$(echo $speed|cut -d. -f 1)
# if
if (( $speed > $limit )) ; then
lynx -nolist -verbose -dump $refer > /tmp/traffic.tmp
mail -s "Httpd traffic overrun" $mailaddr < /tmp/traffic.tmp
rm -rf /tmp/traffic.tmp
#/etc/init.d/httpd restart
fi
|
|
Page Loading [ 0.02 Sec ]
SQL Time [ 0 Sec ]
|
|
|