zoukankan      html  css  js  c++  java
  • 小小的程序监控脚本

    1. dog_fs_curl.sh

    more dog_fs_curl.sh 
    #!/bin/bash
    while true
    do
      status=$(ps aux|grep fs-curl | grep -v grep | grep -v bash | wc -l)
      currdate=$(date "+%Y-%m-%d %H:%M:%S")
      if [ "${status}" = "0" ]; then
        echo "${currdate} - fs-curl process is down!!! error!!!" >> curl.err
        cd /opt/program/fs-curl
        sudo java -jar -Dddg.sys.name=CC_VOIP fs-curl.jar &
        
        sleep 2
        currdate=$(date "+%Y-%m-%d %H:%M:%S")
        echo "${currdate} - fs-curl restart over, recheck status." >> curl.err
    
        status2=$(ps aux|grep fs-curl | grep -v grep | grep -v bash |wc -l)
          if [ "${status2}" = "0"  ]; then
            echo "${currdate} - fs-curl can not restart, start backup machine!!!" >> curl.err
            sudo systemctl stop keepalived.service
          fi
      fi
      sleep 2
    done
  • 相关阅读:
    js中级-函数封装
    js中级-11.7
    js中级-11.5
    js中级-11.2
    js中级-this
    js中级-作用域链
    10.23
    10.22
    10.19js
    10.18
  • 原文地址:https://www.cnblogs.com/yoyotl/p/9088954.html
Copyright © 2011-2022 走看看