From: Nick Hainke Date: Mon, 15 Feb 2021 09:55:26 +0000 (+0100) Subject: prometheus-node-exporter-lua: fix wifi X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=495cdbb39d0b5c332c57aab8011541842d163cd2;p=feed%2Fpackages.git prometheus-node-exporter-lua: fix wifi The "get_wifi_interfaces" function is not returning the wifi interface names. This causes the bug #14625. Fix the "get_wifi_interfaces" function. Signed-off-by: Nick Hainke --- diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile index d094b831fd..26e7e3946a 100644 --- a/utils/prometheus-node-exporter-lua/Makefile +++ b/utils/prometheus-node-exporter-lua/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=prometheus-node-exporter-lua -PKG_VERSION:=2021.01.27 +PKG_VERSION:=2021.02.15 PKG_RELEASE:=1 PKG_MAINTAINER:=Etienne CHAMPETIER diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua index 47ae9a5c59..5e141e6bcf 100644 --- a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua +++ b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua @@ -6,9 +6,9 @@ local function get_wifi_interfaces() local status = u:call("network.wireless", "status", {}) local interfaces = {} - for dev, dev_table in pairs(status) do + for _, dev_table in pairs(status) do for _, intf in ipairs(dev_table['interfaces']) do - table.insert(interfaces, intf['config']['ifname']) + table.insert(interfaces, intf['ifname']) end end