freifunkh / ansible

Here we store all Ansible roles and configs used for Freifunk Hannover.
MIT License
7 stars 3 forks source link

Monitor If Router IPs are Reachable #216

Closed lemoer closed 2 years ago

lemoer commented 2 years ago

Sometimes due to routing issues or radv issues, some of these addresses

Screenshot from 2021-09-11 00-48-17

become unreachable...

I would suggest to monitor them with Zabbix.

lemoer commented 2 years ago
[root@leintor]:/opt/nfctd # curl -s https://harvester.ffh.zone/nodes.json | \
   jq -r '.nodes[] | select( .nodeinfo.hostname == "perf-test") | .nodeinfo.network.addresses[] | select(. | startswith("2"))'
2a02:790:ff:999:250:56ff:fe00:b608
2a02:790:ff:599:250:56ff:fe00:b608
2a02:790:ff:1099:250:56ff:fe00:b608
2001:678:978:299:250:56ff:fe00:b608
2a02:790:ff:799:250:56ff:fe00:b608
lemoer commented 2 years ago

Next level:

curl -s https://harvester.ffh.zone/nodes.json | jq 'def lpad(n):tostring |if (n > length) then ((n - length) * "0") + . else . end; [.nodes[] | select( .nodeinfo.hostname == "perf-test") | .nodeinfo.network.addresses[] | select(. | startswith("2")) | { "peeraddr": ., "supernode": ("sn"+(. | split(":") | .[3] | sub("99$";"") | lpad(2))) }]'
1977er commented 2 years ago

Would pinging hard coded IP addresses be such a bad idea? (But hey, cool jq expression.) :-D

lemoer commented 2 years ago

This is already implemented in the Zabbix Template "FF Statuspage Reachability" (see here: https://zabbix.ffh.zone/templates.php?form=update&templateid=10342)