2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #328 from whyscream/ipvs-udp

Detect UDP conections too
This commit is contained in:
Kenyon Ralph 2013-07-07 18:06:34 -07:00
commit 23c52af983
4 changed files with 9 additions and 9 deletions

View file

@ -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 line number match the line number of the match listen ip, print the line...
if [ "$N" -gt "$MATCH" ]; then if [ "$N" -gt "$MATCH" ]; then
# ... except if the line contain TCP word (this start an other listen) # ... except if the line contain TCP or UDP word (this start an other listen)
if ( echo $line | grep TCP > /dev/null ); then if ( echo $line | grep -e TCP -e UDP > /dev/null ); then
break break
fi fi

View file

@ -75,8 +75,8 @@ ipvsadm -l -n --rate| nl > $F1
for IP in $IPLIST; do for IP in $IPLIST; do
COUNT1=`cat $F1 | grep TCP | grep $IP | awk '{print $7}'` COUNT1=`cat $F1 | grep -e TCP -e UDP | grep $IP | awk '{print $7}'`
COUNT2=`cat $F1 | grep TCP | grep $IP | awk '{print $8}'` 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` NM=`echo $IP | md5sum | cut -d - -f1 | sed 's/ //g' | cut -b 5-9`
echo down$NM.value $COUNT1 echo down$NM.value $COUNT1
echo up$NM.value $COUNT2 echo up$NM.value $COUNT2

View file

@ -93,8 +93,8 @@ for IP in $IPLIST; do
# If line number match the line number of the match listen ip, print the line... # If line number match the line number of the match listen ip, print the line...
if [ "$N" -gt "$MATCH" ]; then if [ "$N" -gt "$MATCH" ]; then
# ... except if the line contain TCP word (this start an other listen) # ... except if the line contain TCP or UDP word (this start an other listen)
if ( echo $line | grep TCP > /dev/null ); then if ( echo $line | grep -e TCP -e UDP > /dev/null ); then
break break
fi fi

View file

@ -5,7 +5,7 @@
=head1 NAME =head1 NAME
ipvs_conn -Indicate the number of conectios per second ipvs_conn -Indicate the number of conections per second
=head1 CONFIGURATION =head1 CONFIGURATION
@ -41,7 +41,7 @@ fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo 'graph_title Ipvs connectios per second' echo 'graph_title Ipvs connections per second'
echo 'graph_args --base 1000 -l 0 ' echo 'graph_args --base 1000 -l 0 '
echo 'graph_vlabel Connections' echo 'graph_vlabel Connections'
echo 'graph_scale no' echo 'graph_scale no'
@ -66,7 +66,7 @@ ipvsadm -l -n --rate| nl > $F1
for IP in $IPLIST; do 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` NM=`echo $IP | md5sum | cut -d - -f1 | sed 's/ //g' | cut -b 5-9`
echo a$NM.value $COUNT echo a$NM.value $COUNT