Python script for use with telegraf to poll various stats from a DrayTek Modem via Telnet. A big part of the script is borrowed from linuxthings.co.uk. I have adapted it so that it works directly with Telegraf.
- Copy the script
draytekstatus.py
to a directory of your choice (I use/opt/telegraf
) - Make the script executable
chmod +x /opt/telegraf/draytekstatus.py
- Configure the script
[[inputs.exec]]
commands = ["python3 /opt/telegraf/draytekstatus.py"]
timeout = "15s"
data_format = "influx"
- Restart telegraf