码迷,mamicode.com
首页 > 其他好文 > 详细

监控named是否开启

时间:2015-04-27 15:09:58      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

监控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

 

监控named是否开启

标签:

原文地址:http://www.cnblogs.com/bluewelkin/p/4460057.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!