prometheus-node-exporter-lua: fix wifi
authorNick Hainke <[email protected]>
Mon, 15 Feb 2021 09:55:26 +0000 (10:55 +0100)
committerEtienne Champetier <[email protected]>
Mon, 15 Feb 2021 13:39:09 +0000 (08:39 -0500)
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 <[email protected]>
utils/prometheus-node-exporter-lua/Makefile
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/hostapd_stations.lua

index d094b831fd7ace0b6b15bb112b4ff15a14133c3d..26e7e3946ae061152510f1747ca9719f5222c52e 100644 (file)
@@ -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 <[email protected]>
index 47ae9a5c59ccb476a253b024abf4b0ef272eecb2..5e141e6bcfd218070bf8bb1fc7f4c4dd827d0b31 100644 (file)
@@ -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