Apache.sh监控
以下shell功能为监控apache是否正常运行,如果不正常运行,就重新启动apacheapache.sh
#!/bin/bash
#apache.sh
nc -w2 localhost 80
if [$? -ne 0]
then
echo "apache's 80 port is down,please you restart the apache progress!"|mailuser1@g.cn-s "apache is down"
/usr/local/apache2/bin/apachectl start
fi
页:
[1]