Python script to telnet into a draytek router and provide the stats for Prometheus

I had a lot of line trouble lately. I knew the router provided the stats but it doesn’t do anything with them. I wanted to visually check the line stats and be able to look as the history of the line.
Prometheus and Grafana seemed the best idea as i had these already in use watching my docker container stats.

A python script to read the detailed DrayTek router stats.

The following stats are recorded and presented as Open Metrics (Prometheus) stats (those that can be used as counters and gauges)