Was debugging Internet performance issues in an office environment recently which was running a Netgear DM200 router – a cheap, slightly dated but still kind of neat little modem that runs BusyBox.
You can ssh to it and run a couple of scripts on it to monitor utilisation.
After some messing around I ended up with this gist, which contains:
- a simple shell script one-liner that runs every 10 seconds to pull the interface stats and send them to a PHP script endpoint
- the PHP script that collects the stats (just writes them to a file on disk, so requires write permission to data.txt in the same directory as the script)
- a super basic PHP script to use as a Prometheus endpoint to scrape for data