Révision f5515445
Better IPv6 handling in suggest mode
| plugins/other/ip6_ | ||
|---|---|---|
| 43 | 43 |
fi |
| 44 | 44 |
|
| 45 | 45 |
if [ "$1" = "suggest" ]; then |
| 46 |
ip6tables -L INPUT -v -n -x 2>/dev/null | awk '$8 ~ /[0-9]/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'
|
|
| 46 |
ip6tables -L INPUT -v -n -x 2>/dev/null | awk --posix '$8 ~ /^([0-9a-f]{1,4}(\:|\:\:)){1,7}([0-9a-f]{1,4})\/([0-9]{1,3})$/ { if (done[$8]!=1) {print $8; done[$8]=1;}}'|sed "s#/[0-9]\{1,3\}##"
|
|
| 47 | 47 |
exit 0 |
| 48 | 48 |
fi |
| 49 | 49 |
|
| 50 | 50 |
if [ "$1" = "config" ]; then |
| 51 |
|
|
| 52 |
echo "graph_order out in" |
|
| 53 |
echo "graph_title $IP traffic" |
|
| 54 |
echo 'graph_args --base 1000' |
|
| 55 |
echo 'graph_vlabel bits per ${graph_period}'
|
|
| 51 |
echo "graph_order out in" |
|
| 52 |
echo "graph_title $IP IPv6 traffic" |
|
| 53 |
echo 'graph_args --base 1000' |
|
| 54 |
echo 'graph_vlabel bits per ${graph_period}'
|
|
| 56 | 55 |
echo 'graph_category network' |
| 57 |
echo 'out.label sent'
|
|
| 58 |
echo 'out.type DERIVE'
|
|
| 59 |
echo 'out.min 0'
|
|
| 60 |
echo 'out.cdef out,8,*'
|
|
| 61 |
echo 'in.label received'
|
|
| 62 |
echo 'in.type DERIVE'
|
|
| 63 |
echo 'in.min 0'
|
|
| 64 |
echo 'in.cdef in,8,*'
|
|
| 65 |
exit 0
|
|
| 56 |
echo 'out.label sent'
|
|
| 57 |
echo 'out.type DERIVE'
|
|
| 58 |
echo 'out.min 0'
|
|
| 59 |
echo 'out.cdef out,8,*'
|
|
| 60 |
echo 'in.label received'
|
|
| 61 |
echo 'in.type DERIVE'
|
|
| 62 |
echo 'in.min 0'
|
|
| 63 |
echo 'in.cdef in,8,*'
|
|
| 64 |
exit 0
|
|
| 66 | 65 |
fi; |
| 67 | 66 |
|
| 68 | 67 |
ip6tables -L INPUT -v -n -x | grep -m1 $IP | awk "{ print \"in.value \" \$2 }"
|
| 69 | 68 |
ip6tables -L OUTPUT -v -n -x | grep -m1 $IP | awk "{ print \"out.value \" \$2 }"
|
| 70 |
|
|
Formats disponibles : Unified diff