use vnstat for traffic statistic now

This commit is contained in:
Arne Fitzenreiter
2008-05-22 22:07:19 +02:00
parent c130ab12d5
commit 6c33dc5c18
10 changed files with 238 additions and 377 deletions

View File

@@ -76,6 +76,9 @@ case "${1}" in
echo_failure
exit 1
fi
# Create/Update vnstat database
/usr/bin/vnstat -u -i ${DEVICE} --force > /dev/null 2>&1
boot_mesg "Adding IPv4 address ${ADDRESS} to the ${DEVICE} interface..."
ip addr add ${args} dev ${DEVICE}
@@ -86,8 +89,10 @@ case "${1}" in
boot_mesg "Removing IPv4 address ${ADDRESS} from the ${DEVICE} interface..."
ip addr del ${args} dev ${DEVICE}
evaluate_retval
;;
esac
# Update vnstat database
/usr/bin/vnstat -u -i ${DEVICE} > /dev/null 2>&1
exit 0;
;;
esac
# End

View File

@@ -88,6 +88,9 @@ case "${1}" in
exit 1
fi
fi
## Create/Update vnstat
/usr/bin/vnstat -u -i ${DEVICE} --force > /dev/null 2>&1
if [ "${TYPE}" == "STATIC" ]; then
@@ -318,7 +321,8 @@ case "${1}" in
evaluate_retval
# echo PPP: /usr/sbin/pppd pty "$PPPOE_CMD" $PPP_STD_OPTIONS $DEBUG $DEMAND $PPPD_SYNC
fi
## Create/Update vnstat
/usr/bin/vnstat -u -i ppp0 --force > /dev/null 2>&1
/etc/rc.d/init.d/connectd start
fi
@@ -372,6 +376,8 @@ case "${1}" in
elif [ "$TYPE" == "PPPOE" ]; then
boot_mesg "Bringing down the PPP interface ..."
## Update vnstat
/usr/bin/vnstat -u -i ppp0 > /dev/null 2>&1
rm -f /var/ipfire/red/keepconnected
killall -w -s TERM /usr/sbin/pppd 2>/dev/null
evaluate_retval
@@ -391,8 +397,11 @@ case "${1}" in
killall -w -s KILL /usr/sbin/pppd >/dev/null 2>&1
killall -w -s KILL br2684ctl >/dev/null 2>&1
rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf}
## Update vnstat
/usr/bin/vnstat -u -i ${DEVICE} > /dev/null 2>&1
exit 0;
;;
esac
# End

View File

@@ -100,6 +100,8 @@ sub updatehdddata
## Update ipac logs
#system ('/usr/sbin/fetchipac');
## Update vnstat
system ('/usr/bin/vnstat -u');
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
system("unlink /tmp/hddstatus && touch /tmp/hddstatus");