Added nickname to Test

This commit is contained in:
Sean Corrigan 2020-07-28 17:13:36 -04:00
parent 2f4829466d
commit 648b2b5fa7

View File

@ -1,4 +1,6 @@
# Sean Corrigan 2020
# Script sends data to influx in bits/sec
import speedtest
import json
from influxdb import InfluxDBClient
@ -6,10 +8,10 @@ from influxdb import InfluxDBClient
serverip = "192.168.0.13"
serverport = 8086
serverdatabase = "telegraf"
servernickname = 'PythonSpeedtest'
servernickname = 'Yoo01pn.ddns.net'
def speed(): # Actual Speedtest using speedtest-cli
servers = [] # If you want to test against a specific server
servers = [] # If you want to test against a specific server eg.
threads = 4
# Choose the amount of threads to use for the test
test = speedtest.Speedtest()
@ -49,7 +51,7 @@ def uploadInfluxdata(host='192.168.0.13', port=8086): # Main upload section
}
}
]
#"time": "2009-11-10T23:00:00Z",
client = InfluxDBClient(host, port, database = serverdatabase) # Init connection to Influx Server
client.write_points(json_body) # Write Speedtest results