标签:
监控named是否开启
#!/bin/bash port=$(nmap -sT localhost | grep ‘domain‘ |awk ‘{print $2}‘) riqi=$(date +"%Y-%m-%d %H:%M") if [ "$port" == "open" ];then echo "$riqi named is ok" >>/home/shell/namedok.txt else /home/wkubuntu/named/sbin/named -c /home/wkubuntu/named/etc/named.conf & sleep 3
/home/wkubuntu/named/sbin/named -c /home/wkubuntu/named/etc/named.conf & echo "$riqi named is restart" >>/home/shell/namederror.txt fi
crontab -e
*/1 * * * * /home/shell/jiangkongnamed.sh
标签:
原文地址:http://www.cnblogs.com/bluewelkin/p/4460057.html