zoukankan      html  css  js  c++  java
  • 光衰报警

    #/bin/bash

    #key1=`cat /data/switch/script/gs/data/10.252.1.252-1 |grep B |awk -F . '{print $1}'`
    #key2=`cat /data/switch/script/gs/data/10.252.1.252-2 |grep B |awk -F . '{print $1}'`
    #num1=`cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep B|awk '{print $1}'`
    #num2=`cat -n /data/switch/script/gs/data/10.252.1.252-2 |grep B|awk '{print $1}'`
    for i in `cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep B|awk '{print $1}'`
    do
    for j in `cat -n /data/switch/script/gs/data/10.252.1.252-2 |grep B|awk '{print $1}'`
    do
    if [ $i -eq $j ];then
    key1=`sed -n ''$i'p' /data/switch/script/gs/data/10.252.1.252-1 |awk -F . '{print $1}'`
    key2=`sed -n ''$i'p' /data/switch/script/gs/data/10.252.1.252-2 |awk -F . '{print $1}'`
    dkey=$(expr $key2 - $key1)
    #echo $dkey
    if [[ $dkey -gt 2 || $dkey -lt -2 ]];then
    yu=$(($i%3))
    if [ $yu = 2 ];then
    interface1=`cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep $(($i-1)) |awk '{print $2}'`
    /usr/bin/curl -s -d "biz_type=net_warn" -d "mobile=" --data-urlencode "content=$ipaddr $interface1 is warning dkey > 3dBm" "http://192.168.7.175:8080/notify/sms/send_warn_sms"
    #echo `cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep $(($i-1)) |awk '{print $2}'`
    else
    interface2=`cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep $(($i-2)) |awk '{print $2}'`
    /usr/bin/curl -s -d "biz_type=net_warn" -d "mobile=" --data-urlencode "content=$ipaddr $interface2 is warning dkey > 3dBm" "http://192.168.7.175:8080/notify/sms/send_warn_sms"
    #echo `cat -n /data/switch/script/gs/data/10.252.1.252-1 |grep $(($i-2)) |awk '{print $2}'`
    fi
    #echo $yu
    #echo $dkey
    #echo $key2
    fi
    fi
    done
    done
    #for key in `cat /data/switch/script/gs/data/10.252.1.252-1 |grep B |awk -F . '{print $1}'`
    #do
    #dkey=$(echo $key+9|bc)
    #if [ 0 -gt $dkey ];then
    # echo "$dkey"
    # else
    # echo "ok"
    #fi
    #done
    #i=`cat /data/switch/script/gs/data/10.252.1.252-1 |grep B |awk -F . '{print $1}'`

  • 相关阅读:
    Unable to connect to Command Metric Stream 'api/turbine/stream?cluster=REPORTS' Error: {"isTrusted"}
    Spring Boot Admin 1.5.7
    Druid Spring Boot Starter
    09: mysql基础面试题
    08: mysql主从原理
    07: mysql锁和事物隔离
    06: mysql索引查找原理及调优
    05: MySQL高级查询
    04: Mysql性能优化
    02: MySQL的安装与基本配置
  • 原文地址:https://www.cnblogs.com/han1094/p/8583384.html
Copyright © 2011-2022 走看看