Alcatel Speedtouch Home Statistics

A Python script to query your modem for bandwidth usage


[ Download | Changelog | Known Bugs | Installation | Contact ]

Why?

I created this script because I wanted to visualize my internet traffic. Since this Alcatel modem does not support SNMP I couldn't let MRTG query it for data, so I wrote this python script.

Download

Changelog

Known bugs

Installation

This guide assumes you managed to install MRTG properly. If not, download
MRTG and install it before proceeding with the installation, because without MRTG this script isn't of much use.
  1. Download the script above and place it in an appropriate directory.
  2. Run the script by hand by typing:
    $ ./modemstat -m ip_modem
    and see what happens. If it's ok you should get something like this:
    4857
    3856
    uptime
    load router.qwoot.net
    	
    If not, you should check your hostname and permissions to write to /tmp/.modemdata and /var/log/modemlog. If your modem requires a password supply the -p option too. Otherwise report it as a bug (see the 'Contact' section below)
  3. Configure MRTG.
    Create a file named /etc/mrtg/modemstat.cfg (for example) with the following content:
    WorkDir: path_to_where_mrtg_should_put_the_graph
    Options[_]: nopercent,growright,nobanner,nolegend,noinfo,gauge
    MaxBytes[_]: 125000000
    
    Target[alcatel_speedtouch]: `path_to_the_modemstat_script -m ip_modem`
    Options[alcatel_speedtouch]: nopercent,growright,nolegend,noinfo,nobanner,integer,gauge,pngdate
    Title[alcatel_speedtouch]: Load for Alcatel Speedtouch Modem
    	
  4. Run MRTG by hand.
    Type:
    /usr/local/mrtg-2/bin/mrtg /etc/mrtg/modemstat.cfg
    	
    to run MRTG. The first two times you run MRTG it will complain a bit but that should disappear the third time ;)
  5. If the output looks ok you can put it in a crontab or something (of course you can run it by hand every 5 minutes ;)). type:
    $ crontab -e
    	
    and add something like this:
    0-59/5 * * * * /usr/local/mrtg-2/bin/mrtg /etc/mrtg/modemstat.cfg 1> /dev/null
    
Good Luck!

Contact

For bugs, info or feature requests you can mail me at:
	alex at qwoot dot net


Last Updated on July 11, 2005