Monitoring TalkTalk Router bandwidth 5/5 (1)

Having treated myself to a 4K TV recently, and the fact there is _some_ 4K or UHD content available through Amazon Prime and Netflix I wondered what the actual bandwidth requirements of streaming this kind of stuff down are. No problem, I’ll just sling up the excellent MRTG and find out I thought.

Oh no, it’s not that easy. I have an FTTC service provided by TalkTalk. The VDSL modem/router is a “Super Router” also known as the Huawei HG633. Running firmware v1.15t it has neither SNMP nor telnet/SSH or any other kind of CLI access. Bit of a dead end really. Still not to worry, I only use the HG633 to terminate the VDSL, it has an Ethernet uplink to an Apple AirPort Extreme that provides Wi-Fi for the house and a couple of gigabit connected wired devices (thanks TalkTalk for providing me with an 80/20 Mbps WAN product and only 100Mbps LAN side). Apple however have also removed SNMP capability from the AirPort range. *GRR*. Now the obvious solution is to get a proper modem/router/access point but these things are sent to challenge us. The HG633 has a tolerable web admin interface, which does expose some statistics, so we can surely yank those out with a bit of patience.

Turns our it is all JavaScript based in the HG633, but no worries, the excellent PhantomJS to the rescue. Lurking on the home LAN is a Raspberry PI Model 3, which proves to be more than up to the task of driving this headless JavaScript engine. After I little bit of tinkering I was able to generate a PhantomJS script which would login to the router, navigate to the appropriate page, and then dump the DOM out. Judicious use of text parsing results in getting the required information out of the admin gui, and which point it’s trivial to feed it to MRTG.

The results can be seen at

The code is ugly, doesn’t really cope with error conditions all that well, and is heavily dependent on some of the DOM structure in the router’s management page which will doubtless get screwed the next time TalkTalk pushes down a firmware update. Still perhaps the next firmware update will re-enable the CLI.

When there is a will, there is a way even if it is a slightly stupid one, which certainly fails to deal with asynchronous requests properly or even work all the time.

I hesitate to even publish the code, but as it was an annoying enough problem to “solve” the PhantomJS script is available router.js.txt And the horrible bash script called by MRTG

Since the Huawei HG633 was updated to firmware 1.18t the scripts broke (no surprise really, given the lack of API and HTML scraping. The updated JS script is available router-1.18t.js.txt now.