Getting Modem Statistics to Cacti

I’ve been having problems with a flaky DSL connection from CenturyLink. My modem would frequently ‘retrain,’ that is, disconnect and reconnect the DSL session. This is rather annoying, and since I use VoIP for most phone calls when I’m at home, very irritating.

I wanted a method to log the modem’s statistics and see if I could find any correlation with the drops. One of the unfortunate realities with consumer level equipment is the lack of standard monitoring capabilities. Most enterprise level equipment support SNMP, which allows various software programs to request information.

To solve this dilemma, I wrote a script in python that scrapes my modem’s WAN statistics page and output the numbers in a format that Cacti can interpret.

Find it on github. A couple notes, this is written for my modem, a Zyxel Q100. Additionally, it was written for the currently installed version of the firmware, QZQ002-4.2.001.1-Q100. If you have a different modem, or different firmware version, feel free to modify it. I’d be happy if you submitted pull requests with scripts for the different modems as well.

You can use this script as a data input method for Cacti and get pretty graphs like this:

Pretty graph using Cacti and the script
Pretty graph using Cacti and the script
Click to share: Share on FacebookShare on Google+Share on RedditTweet about this on TwitterPin on Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *