Browse Source

ffhb influxdb babel (+jool): snippets

main
Geno 6 months ago
parent
commit
47413b04f2
  1. 8
      ffhb/babel/README.md
  2. 2
      ffhb/babel/jool.sh
  3. 21
      ffhb/babel/routes.sh
  4. 4
      ffhb/babel/telegraf-jool.conf
  5. 4
      ffhb/babel/telegraf-routes.conf

8
ffhb/babel/README.md

@ -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`

2
ffhb/babel/jool.sh

@ -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/')"

21
ffhb/babel/routes.sh

@ -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"

4
ffhb/babel/telegraf-jool.conf

@ -0,0 +1,4 @@
[[inputs.exec]]
commands = ["sudo /usr/local/bin/influxdb-jool.sh"]
timeout = "30s"
data_format = "influx"

4
ffhb/babel/telegraf-routes.conf

@ -0,0 +1,4 @@
[[inputs.exec]]
commands = ["/usr/local/bin/influxdb-routen.sh"]
timeout = "30s"
data_format = "influx"
Loading…
Cancel
Save