• 光衰报警


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

  • 相关阅读:
    Centos下使用gitosis配置管理git服务端(转载)
    学习git遇到的一些简单错误
    通过IP连接网上打印机(转载)
    Porlet标准:JSR168/JSR286/WSRP(转载)
    网络泛洪(转载)
    Linux Shell入门(转载)
    Shell中set用法(转载)
    数据结构实验之链表五:单链表的拆分(SDUT 2120)
    数据结构实验之链表五:单链表的拆分(SDUT 2120)
    数据结构实验之链表四:有序链表的归并(SDUT 2119)
  • 原文地址:https://www.cnblogs.com/han1094/p/8583384.html
Copyright © 2020-2023  润新知