From 495cdbb39d0b5c332c57aab8011541842d163cd2 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Mon, 15 Feb 2021 10:55:26 +0100 Subject: [PATCH] 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 --- utils/prometheus-node-exporter-lua/Makefile | 2 +- .../usr/lib/lua/prometheus-collectors/hostapd_stations.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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