fff-simple-tc: provide status via nodewatcher

Add traffic control status and rates to alfred data, which is also
available for the Monitoring then.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Adrian Schmutzler 2020-04-22 16:54:45 +02:00 committed by Fabian Bläse
parent ed73e00588
commit da6013ec97
2 changed files with 24 additions and 1 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-simple-tc
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -0,0 +1,23 @@
#!/bin/sh
. /lib/functions.sh
config_load simple-tc
tc_enabled="0"
tc_in="0"
tc_out="0"
parseTcInterface() {
local iface="$1"
config_get ifname "$iface" ifname
[ "wan" = "$ifname" ] || return
config_get tc_enabled "$iface" enabled "0"
config_get tc_in "$iface" limit_ingress "0"
config_get tc_out "$iface" limit_egress "0"
}
config_foreach parseTcInterface 'interface'
echo -n "<traffic_control><wan><enabled>$tc_enabled</enabled><in>$tc_in</in><out>$tc_out</out></wan></traffic_control>"
exit 0