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}'`

  • 相关阅读:
    洛谷P4315 月下“毛景树”(边权维护)
    Water Tree CodeForces
    P3384 【模板】树链剖分
    Codeforces 161D Distance in Tree(树的点分治)
    git命令及使用方法
    vue下拉刷新,下拉加载更多
    Vue中 v-for 生成样式并默认选中第一个样式
    js面向对象实现分页版轮播图
    js面向对象实现购物车
    js面向对象实现放大镜
  • 原文地址:https://www.cnblogs.com/han1094/p/8583384.html
Copyright © 2011-2022 走看看