Have Uverse service? Wondering how much bandwidth you use? Here is a script that plays nice with cacti, that can fetch bandwidth data from your Uverse 2-Wire 3800HGV-B Residential Gateway. See the full post for more info!
This script will use the management web page of your router to pull down bandwidth stats, and dump it out in a cacti-friendly way where it can be picked up and pumped into a graph. You can use features in cacti to generate more in-depth statistics, or put a script in cron to take a monthly stamp, subtract out the difference, and email you the result. You know, if you are into that kind of thing.
#!/bin/bash
> /tmp/bandwpage.tmp
wget http://192.168.1.254/xslt?PAGE=C_1_0 -o /dev/null -O /tmp/bandwpage.tmp
start=`cat /tmp/bandwpage.tmp | nl | grep "Traffic Statistics" | awk '{print $1}'`
end=`cat /tmp/bandwpage.tmp | tail -n +$start | nl | grep "/table" | head -1 | awk '{print $1}'`
snippet=`cat /tmp/bandwpage.tmp | tail -n +$start | head -$end | tr '\n' '#' | tr '<>' ' '`
# echo $snippet | tr '#' '\n' | nl -n ln
echo -n "Transmit_Bytes:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^12 | awk '{print $3}'`
echo -n " Transmit_Packets:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^13 | awk '{print $3}'`
echo -n " Transmit_Errors:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^14 | awk '{print $3}'`
echo -n " Receive_Bytes:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^19 | awk '{print $3}'`
echo -n " Receive_Packets:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^20 | awk '{print $3}'`
echo -n " Receive_Errors:"`echo $snippet | tr '#' '\n' | nl -n ln | grep ^21 | awk '{print $3}'`
rm -rf /tmp/bandwpage.tmp