Icinga2 bandwidth monitoring of OpenWRT routers

Disclaimer: this is most probably not the best way to do this.

Context: I use icinga2 to monitor most of my servers and (home/office) routers. Since icinga collects "perfdata" (performance data) and supports sending that data to Graphite, I then use Grafana to produce graphics of the network usage on my network.

Quick notes for me:

generate an ssh key for the nagios user in /var/lib/nagios/.ssh (easier done by doing a sudo to nagios, to avoid having to fix permissions/ownership afterwards).

copy the "check_bandwidth" script to the OpenWRT device. (nb: check_bandwidth was written by Benjamin Dos Santos, I did two small changes in my fork to support OpenWRT and output the status in the format required for perfdata).