ffhb influxdb babel (+jool): snippets
This commit is contained in:
parent
a7406ecc89
commit
47413b04f2
|
@ -0,0 +1,8 @@
|
||||||
|
put `telegraf-*.conf` in
|
||||||
|
`/etc/telegraf/telegraf.d/`
|
||||||
|
|
||||||
|
and the .sh in a legal place like:
|
||||||
|
`/usr/local/bin/`
|
||||||
|
|
||||||
|
and fix the paths in the
|
||||||
|
`telegraf-*.conf`
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
echo "jool $(/usr/local/bin/jool stats display | sed -e 's/: /=/' | tr '[:upper:]' '[:lower:]' | tr '\n' ',' | sed '$s/,$/\n/')"
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
node_prefix6="2a06:8782:ffbb:bab0:"
|
||||||
|
prefix6="2a06:8782:ffbb:bab1:"
|
||||||
|
node_client_prefix6="fd2f:5119:f2c::"
|
||||||
|
|
||||||
|
dump="$(ip -6 r s t default-freifunk )"
|
||||||
|
|
||||||
|
route_ap=$(echo "$dump" | grep -v "/" | grep -c $node_prefix6 )
|
||||||
|
route_client=$(echo "$dump" | grep -v "/" | grep -c $prefix6 )
|
||||||
|
route_fec0=$(echo "$dump" | grep -v "/" | grep -c $node_client_prefix6 )
|
||||||
|
route_other=$(echo "$dump" | grep -v "/" \
|
||||||
|
| grep -v $node_prefix6 \
|
||||||
|
| grep -v $prefix6 \
|
||||||
|
| grep -v $node_client_prefix6 \
|
||||||
|
| grep -v "unreachable" \
|
||||||
|
| grep -v "default" \
|
||||||
|
| wc -l )
|
||||||
|
route_net=$(echo "$dump" | grep -c "/" )
|
||||||
|
route_total=$(echo "$dump" | wc -l )
|
||||||
|
|
||||||
|
echo "route_babel ap=${route_ap}i,client=${route_client}i,fec0=${route_fec0}i,other=${route_other}i,net=${route_net}i,total=${route_total}i"
|
|
@ -0,0 +1,4 @@
|
||||||
|
[[inputs.exec]]
|
||||||
|
commands = ["sudo /usr/local/bin/influxdb-jool.sh"]
|
||||||
|
timeout = "30s"
|
||||||
|
data_format = "influx"
|
|
@ -0,0 +1,4 @@
|
||||||
|
[[inputs.exec]]
|
||||||
|
commands = ["/usr/local/bin/influxdb-routen.sh"]
|
||||||
|
timeout = "30s"
|
||||||
|
data_format = "influx"
|
Loading…
Reference in New Issue