使用shell脚本监测web网站
SHELL
i=`netstat -lntup|grep nginx|wc -l`
panduan(){
if [ "$1" != "web" ]
then
echo "please in (web) "
exit 1
else
echo
fi
}
jyt(){
if [ $i -eq 0 ]
then
echo "nginx down web is down"
else
echo "nginx is ok web is ok"
fi
}
case "$1" in
web)
jyt
;;
*)
panduan
esac
菜鸟9528号,请求开炮。