packages/admin/zabbix/files/network
Etienne Champetier 5d1aa99648 zabbix: use ubus for zabbix-extra-network
this allow us to stop using uci /var/state,
which is deprecated since forever

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2018-10-23 19:26:38 -04:00

6 lines
543 B
Text

#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates
# network interface discovery
# example: {"data":[{"{#IF}":"lo", "{#NET}":"loopback"},{"{#IF}":"br-lan", "{#NET}":"lan"},{"{#IF}":"eth0.1", "{#NET}":"wan"}]}
#
UserParameter=netowrt.discovery,lua -l ubus -e 'u=ubus.connect();list="{\"data\":[";dump=u:call("network.interface", "dump", {});for _, intf in ipairs(dump.interface) do list=list.."{\"{#IF}\":\""..intf.device.."\", \"{#NET}\":\""..intf.interface.."\"},";end;list=string.gsub(list,",$","");print(list.."]}")'