Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 1.22 KB

README.md

File metadata and controls

28 lines (23 loc) · 1.22 KB

RTT-API-telegraf

This program is a script meant to be called from Telegraf which queries RealTimeTrains' UK train API, and counts cancelled, late and on-time trains per-day in an sqlite database. It outputs the data in a format readable from Telegraf and I intend to use it to feed in to Influx, and draw pretty graphs of cancelled trains in Grafana.

Requirements

  • telegraf
  • python 3
  • python module "requests"
  • API account with realtimetrains

Usage

[[inputs.exec]]
commands = [ "/bin/bash /opt/RTT_API/run.sh rttapi_username rttapi_password stationcode"]
  timeout = "60s"
  name_suffix = "traindata"
  data_format = "logfmt"