Commit c6b38c10 authored by Ralf's avatar Ralf

fix script

parent ec7b7fd1
#!/bin/bash
TIME=$(date +%s)
STEP=120
function display {
......@@ -12,6 +11,7 @@ function display {
}
function show_bw {
TIME=$(date +%s)
RX=$(curl -s "https://mgmt.saar.freifunk.net/grafana/api/datasources/proxy/1/api/v1/query_range?query=total_traffic_rx_bits_per_second&start=$TIME&end=$TIME&step=$STEP" | jq .data.result[0].values[0][1] | cut -d '"' -f 2)
TX=$(curl -s "https://mgmt.saar.freifunk.net/grafana/api/datasources/proxy/1/api/v1/query_range?query=total_traffic_tx_bits_per_second&start=$TIME&end=$TIME&step=$STEP" | jq .data.result[0].values[0][1] | cut -d '"' -f 2)
RX=$(bc <<< "scale=1; $RX/1024/1024")
......@@ -21,6 +21,7 @@ function show_bw {
}
function show_users {
TIME=$(date +%s)
CLIENTS=$(curl -s "https://mgmt.saar.freifunk.net/grafana/api/datasources/proxy/1/api/v1/query_range?query=total_clients&start=$TIME&end=$TIME&step=$STEP" | jq .data.result[0].values[0][1] | cut -d '"' -f 2)
NODES=$(curl -s "https://mgmt.saar.freifunk.net/grafana/api/datasources/proxy/1/api/v1/query_range?query=meshnodes_online_total&start=$TIME&end=$TIME&step=$STEP" | jq .data.result[0].values[0][1] | cut -d '"' -f 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment