Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hacksaar
ff-schild
Commits
c6b38c10
Commit
c6b38c10
authored
Mar 03, 2019
by
Ralf
Browse files
fix script
parent
ec7b7fd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
freifunk.sh
View file @
c6b38c10
#!/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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment