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:
commit
23c52af983
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 [ "$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
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ipvs_conn -Indicate the number of conectios per second
|
||||
ipvs_conn -Indicate the number of conections per second
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
@ -41,7 +41,7 @@ fi
|
||||
|
||||
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_vlabel Connections'
|
||||
echo 'graph_scale no'
|
||||
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user