diff --git a/plugins/ipvs/ipvs_active b/plugins/ipvs/ipvs_active index 87a04099..b9e37973 100755 --- a/plugins/ipvs/ipvs_active +++ b/plugins/ipvs/ipvs_active @@ -90,8 +90,8 @@ for IP in $IPLIST; do # If line number match the line number of the match listen ip, print the line... if [ "$N" -gt "$MATCH" ]; then - # ... except if the line contain TCP word (this start an other listen) - if ( echo $line | grep TCP > /dev/null ); then + # ... except if the line contain TCP or UDP word (this start an other listen) + if ( echo $line | grep -e TCP -e UDP > /dev/null ); then break fi diff --git a/plugins/ipvs/ipvs_bps b/plugins/ipvs/ipvs_bps index 0907bb4e..df198ce3 100755 --- a/plugins/ipvs/ipvs_bps +++ b/plugins/ipvs/ipvs_bps @@ -75,8 +75,8 @@ ipvsadm -l -n --rate| nl > $F1 for IP in $IPLIST; do - COUNT1=`cat $F1 | grep TCP | grep $IP | awk '{print $7}'` - COUNT2=`cat $F1 | grep TCP | grep $IP | awk '{print $8}'` + COUNT1=`cat $F1 | grep -e TCP -e UDP | grep $IP | awk '{print $7}'` + COUNT2=`cat $F1 | grep -e TCP -e UDP | grep $IP | awk '{print $8}'` NM=`echo $IP | md5sum | cut -d - -f1 | sed 's/ //g' | cut -b 5-9` echo down$NM.value $COUNT1 echo up$NM.value $COUNT2 diff --git a/plugins/ipvs/ipvs_cps b/plugins/ipvs/ipvs_cps index 5a2274df..d67cc746 100755 --- a/plugins/ipvs/ipvs_cps +++ b/plugins/ipvs/ipvs_cps @@ -66,7 +66,7 @@ ipvsadm -l -n --rate| nl > $F1 for IP in $IPLIST; do - COUNT=`cat $F1 | grep TCP | grep $IP | awk '{print $4}'` + COUNT=`cat $F1 | grep -e TCP -e UDP | grep $IP | awk '{print $4}'` NM=`echo $IP | md5sum | cut -d - -f1 | sed 's/ //g' | cut -b 5-9` echo a$NM.value $COUNT