监控Storm进程 NimbusMonitor.sh

来源:互联网 发布:corelpainter mac 编辑:程序博客网 时间:2024/05/29 07:48
#!/bin/bash  #author:  chongyuanHuang#blog:               http://blog.sina.com.cn/huangchongyuan    #QQ group:      191321336#E-mail:   874450476@qq.com  function Init() {         date=`date +%Y%m%d%H%M%S`         echo ''$date': Begin monitor nimbus.' > monitorNimbus.log}  function MonitorNimbus() {         for ((;;)); do                   num=`ps aux | grep nimbus | grep -v grep | wc -l`                   if [ $num -eq 0 ]; then                            date1=`date +%Y%m%d%H%M%S`                            echo ''$date1': nimbus is down, and restarting!' >> monitorNimbus.log                            storm nimbus&                   fi                   sleep 60         done          }  InitMonitorNimbusexit 1

0 0