grafana

speedtest

#
# Install speedtest cli from SpeedTest.net first
# https://www.speedtest.net/apps/cli
#
# And then run speedtest once to accept the license
#

[[inputs.exec]]
  commands = ["/usr/bin/speedtest -f json"]
  name_override = "speedtest"
  timeout = "1m"
  interval = "5m"
  data_format = "json"
  json_string_fields = [ "interface_externalIp",
                         "server_name",
                         "server_location",
                         "server_host",
                         "server_ip",
                         "result_url" ]

licence

This also works, I think???

/etc/telegraf/.config/ookla/speedtest-cli.json

{
    "Settings": {
        "LicenseAccepted": "0123456789abcde0123456789abcde0123456789abcde0123456789abcde0123"
    }
}

minecraft

[[inputs.exec]]
  commands = ["/usr/local/bin/mcstatus SERVERNAME json"]
  name_override = "SERVERNAME_mcstats"
  timeout = "1m"
  interval = "1m"
  data_format = "json"
  json_string_fields = [ "online",
                         "ping",
                         "player_count",
                         "player_max" ]

mcstatus

#!/usr/bin/python3

# -*- coding: utf-8 -*-
import re
import sys

from mcstatus.scripts.mcstatus import cli

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(cli())