Browse Source

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 <jajcus@jajcus.net>
lilik-openwrt-22.03
Jacek Konieczny 3 years ago
committed by Etienne Champetier
parent
commit
30007d3804
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      admin/zabbix/Makefile
  2. +1
    -1
      admin/zabbix/files/network

+ 1
- 1
admin/zabbix/Makefile View File

@ -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/


+ 1
- 1
admin/zabbix/files/network View File

@ -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.."]}")'

Loading…
Cancel
Save