File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ if [ ! -d "$RRD/net" ]; then
3636fi
3737
3838# Parsing network interfaces
39- ifaces=$( cat /proc/net/dev | grep : | cut -f 1 -d : | sed -e " s/ //g" )
39+ ndev=$( cat /proc/net/dev)
40+ ifaces=$( echo " $ndev " | grep : | cut -f 1 -d : | sed -e " s/ //g" )
4041
4142# Parsing excludes
4243for exclude in $( echo ${RRD_IFACE_EXCLUDE// ,/ } ) ; do
@@ -62,9 +63,9 @@ for iface in $ifaces; do
6263
6364 # Parsing device stats
6465 if [ " $period " = ' daily' ]; then
65- raw_iface =$( grep " $iface : " /proc/net/dev | sed -e " s/:/ /" )
66- rx=$( echo " $raw_iface " | awk ' {print $2}' )
67- tx=$( echo " $raw_iface " | awk ' {print $10}' )
66+ x =$( echo " $ndev " | sed -e " s/^ *// " | grep " ^ $iface : " | sed -e " s/:/ /" )
67+ rx=$( echo " $x " | awk ' {print $2}' )
68+ tx=$( echo " $x " | awk ' {print $10}' )
6869
6970 # Updating rrd database
7071 rrdtool update $RRD /net/$iface .rrd N:$rx :$tx
You can’t perform that action at this time.
0 commit comments