Thursday, 5 March 2015

Plusnet router MRTG script

Wow, its been a while since I put anything on here!

Anyway, following on from my post about capturing MRTG stats from my old BE ADSL router (here) I have since moved over to Plus.net and received one of their lovely routers. No SNMP support on this either so heres a nice script to login and scrape the html from the router admin page, fully compatible with the old BE mrtg config and data

With a few bits of mrtg config, like..

Title[ADSL_SYNC]: ADSL - Sync Speed
PageTop[ADSL_SYNC]: <H1>ADSL Sync Speed</H1>
Target[ADSL_SYNC]: `/var/www/adsl.sh sync`
MaxBytes[ADSL_SYNC]: 24000
YLegend[ADSL_SYNC]: Sync Speed (kbps)
Unscaled[ADSL_SYNC]: y
LegendI[ADSL_SYNC]: Down Sync Speed
ShortLegend[ADSL_SYNC]: <br/>
LegendO[ADSL_SYNC]: Up Sync Speed
XSize[ADSL_SYNC]: 600
YSize[ADSL_SYNC]: 200
Options[ADSL_SYNC]: gauge,nolegend,nobanner,nopercent


You end up with something like this...

 

No comments:

Post a Comment