|
@@ -16,6 +16,7 @@ result_id=$(echo "${json_result}" | jq -r '.result.id')
|
|
ping_latency=$(echo "${json_result}" | jq -r '.ping.latency')
|
|
ping_latency=$(echo "${json_result}" | jq -r '.ping.latency')
|
|
download_bandwidth=$(echo "${json_result}" | jq -r '.download.bandwidth')
|
|
download_bandwidth=$(echo "${json_result}" | jq -r '.download.bandwidth')
|
|
upload_bandwidth=$(echo "${json_result}" | jq -r '.upload.bandwidth')
|
|
upload_bandwidth=$(echo "${json_result}" | jq -r '.upload.bandwidth')
|
|
|
|
+packet_loss=$(echo "${json_result}" | jq -r '.packetLoss')
|
|
|
|
|
|
# Ensure InfluxDB database exists
|
|
# Ensure InfluxDB database exists
|
|
curl \
|
|
curl \
|
|
@@ -24,5 +25,5 @@ curl \
|
|
|
|
|
|
# Write metric to InfluxDB
|
|
# Write metric to InfluxDB
|
|
curl \
|
|
curl \
|
|
- -d "speedtest,result_id=${result_id} ping_latency=${ping_latency},download_bandwidth=${download_bandwidth},upload_bandwidth=${upload_bandwidth}" \
|
|
|
|
|
|
+ -d "speedtest,result_id=${result_id} ping_latency=${ping_latency},download_bandwidth=${download_bandwidth},upload_bandwidth=${upload_bandwidth},packet_loss=${packet_loss}" \
|
|
"${influxdb_url}/write?db=${influxdb_db}"
|
|
"${influxdb_url}/write?db=${influxdb_db}"
|