mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
prometheus-node-exporter-lua: an unavaliable wifi interface may have stopped the scraper from functioning
Signed-off-by: Zoltan Haindrich <kirk@rxd.hu>
This commit is contained in:
committed by
Etienne Champetier
parent
a3af4c3691
commit
7bec619f53
@@ -13,6 +13,7 @@ local function scrape()
|
||||
for dev, dev_table in pairs(status) do
|
||||
for _, intf in ipairs(dev_table['interfaces']) do
|
||||
local ifname = intf['ifname']
|
||||
if ifname ~= nil then
|
||||
local iw = iwinfo[iwinfo.type(ifname)]
|
||||
local labels = {
|
||||
channel = iw.channel(ifname),
|
||||
@@ -38,6 +39,7 @@ local function scrape()
|
||||
metric_wifi_network_signal(labels, iw.signal(ifname) or -255)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return { scrape = scrape }
|
||||
|
||||
+2
@@ -26,6 +26,7 @@ local function scrape()
|
||||
for dev, dev_table in pairs(status) do
|
||||
for _, intf in ipairs(dev_table['interfaces']) do
|
||||
local ifname = intf['ifname']
|
||||
if ifname ~= nil then
|
||||
local iw = iwinfo[iwinfo.type(ifname)]
|
||||
local count = 0
|
||||
|
||||
@@ -64,6 +65,7 @@ local function scrape()
|
||||
metric_wifi_stations({ifname = ifname}, count)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return { scrape = scrape }
|
||||
|
||||
Reference in New Issue
Block a user