#!/bin/sh traffic= rm -rf test.txt
data=`sqlplus -S anoscfg/anoscfg <<EOF
spool test.txt
set pages
set feed off
set heading off;
set feedback off;
set verify off;
set linesize ;
select TIME_START, SGSN, round(UL_FLOW/(*),), round(DL_FLOW/(*),) from (select * from RT_SGSN_FLOW_5 order by TIME_start desc ) where rownum <;
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"
fi if [ $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