From: Jacek Konieczny Date: Fri, 19 Nov 2021 16:55:19 +0000 (+0100) Subject: zabbix: fix 6in4 network interface discovery X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=30007d380466b76a6f8ea3dbbdc1fa2c9d1704a6;p=feed%2Fpackages.git zabbix: fix 6in4 network interface discovery Those devices don't have 'device' propery, only 'l3_device', which causes 'attempt to concatenate field 'device' (a nil value)' lua error. Use 'l3_device' as a fallback in this case. Signed-off-by: Jacek Konieczny --- diff --git a/admin/zabbix/Makefile b/admin/zabbix/Makefile index 333a60977b..0eeab81f32 100644 --- a/admin/zabbix/Makefile +++ b/admin/zabbix/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zabbix PKG_VERSION:=5.0.7 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://cdn.zabbix.com/zabbix/sources/stable/5.0/ diff --git a/admin/zabbix/files/network b/admin/zabbix/files/network index 43a0d3943d..96bf194fab 100644 --- a/admin/zabbix/files/network +++ b/admin/zabbix/files/network @@ -3,4 +3,4 @@ # 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.."]}")' +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 or intf.l3_device).."\", \"{#NET}\":\""..intf.interface.."\"},";end;list=string.gsub(list,",$","");print(list.."]}")'