mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
prometheus-node-exporter-lua: check if status is nil before processing wifi device metrics interfaces
Signed-off-by: Jun Ouyang <ouyangjun1999@gmail.com>
This commit is contained in:
committed by
Etienne Champetier
parent
7d9cc2e95a
commit
f39d51b14c
@@ -4,7 +4,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=prometheus-node-exporter-lua
|
||||
PKG_VERSION:=2026.05.09
|
||||
PKG_VERSION:=2026.05.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
|
||||
|
||||
@@ -10,6 +10,10 @@ local function scrape()
|
||||
local u = ubus.connect()
|
||||
local status = u:call("network.wireless", "status", {})
|
||||
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
for dev, dev_table in pairs(status) do
|
||||
for _, intf in ipairs(dev_table['interfaces']) do
|
||||
local ifname = intf['ifname']
|
||||
|
||||
+4
@@ -23,6 +23,10 @@ local function scrape()
|
||||
local u = ubus.connect()
|
||||
local status = u:call("network.wireless", "status", {})
|
||||
|
||||
if not status then
|
||||
return
|
||||
end
|
||||
|
||||
for dev, dev_table in pairs(status) do
|
||||
for _, intf in ipairs(dev_table['interfaces']) do
|
||||
local ifname = intf['ifname']
|
||||
|
||||
Reference in New Issue
Block a user