首页 > 代码库 > shell oracle
shell oracle
#!/bin/shtraffic=10rm -rf test.txtdata=`sqlplus -S anoscfg/anoscfg <<EOFspool test.txtset pages 0 set feed offset heading off;set feedback off;set verify off;set linesize 1000;select TIME_START, SGSN, round(UL_FLOW/(1024*1024),0), round(DL_FLOW/(1024*1024),0) from (select * from RT_SGSN_FLOW_5 order by TIME_start desc ) where rownum <5;EOF`data_1_up=`echo $data |awk -F‘ ‘ ‘{print $3}‘`data_2_up=`echo $data |awk -F‘ ‘ ‘{print $7}‘`data_11_up=`echo $data |awk -F‘ ‘ ‘{print $11}‘`data_22_up=`echo $data |awk -F‘ ‘ ‘{print $15}‘`num_092_up=`expr ${data_11_up} / ${traffic}`num_221_up=`expr ${data_22_up} / ${traffic}`if [ ${data_1_up} -lt ${num_092_up} ];then echo ‘alarm‘ ‘warning‘ ‘is‘ "SGSN 092 UL_flow $data_1_up -lt $data_11_up `date ‘+%Y-%m-%d %T‘`" "$HOSTNAME" fiif [ $data_2_up -lt $num_221_up ];then echo ‘alarm‘ ‘warning‘ ‘is‘ "SGSN 221 UL_flow $data_2_up -lt $data_22_up `date ‘+%Y-%m-%d %T‘`" "$HOSTNAME" fi
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。