Skip to content

Commit 2ced78b

Browse files
authored
Check status before processing wireless interfaces
Add a check for status before processing wireless devices. Signed-off-by: Jun Ouyang <[email protected]>
1 parent 405a404 commit 2ced78b

File tree

1 file changed

+4
-0
lines changed
  • utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors

1 file changed

+4
-0
lines changed

utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/wifi_stations.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ local function scrape()
2323
local u = ubus.connect()
2424
local status = u:call("network.wireless", "status", {})
2525

26+
if not status then
27+
return
28+
end
29+
2630
for dev, dev_table in pairs(status) do
2731
for _, intf in ipairs(dev_table['interfaces']) do
2832
local ifname = intf['ifname']

0 commit comments

Comments
 (0)