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>
(cherry picked from commit 7bec619f53)
This commit is contained in:
committed by
Etienne Champetier
parent
0e69b14733
commit
928915f4a6
@@ -13,6 +13,7 @@ local function scrape()
|
|||||||
for dev, dev_table in pairs(status) do
|
for dev, dev_table in pairs(status) do
|
||||||
for _, intf in ipairs(dev_table['interfaces']) do
|
for _, intf in ipairs(dev_table['interfaces']) do
|
||||||
local ifname = intf['ifname']
|
local ifname = intf['ifname']
|
||||||
|
if ifname ~= nil then
|
||||||
local iw = iwinfo[iwinfo.type(ifname)]
|
local iw = iwinfo[iwinfo.type(ifname)]
|
||||||
local labels = {
|
local labels = {
|
||||||
channel = iw.channel(ifname),
|
channel = iw.channel(ifname),
|
||||||
@@ -38,6 +39,7 @@ local function scrape()
|
|||||||
metric_wifi_network_signal(labels, iw.signal(ifname) or -255)
|
metric_wifi_network_signal(labels, iw.signal(ifname) or -255)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return { scrape = scrape }
|
return { scrape = scrape }
|
||||||
|
|||||||
+2
@@ -26,6 +26,7 @@ local function scrape()
|
|||||||
for dev, dev_table in pairs(status) do
|
for dev, dev_table in pairs(status) do
|
||||||
for _, intf in ipairs(dev_table['interfaces']) do
|
for _, intf in ipairs(dev_table['interfaces']) do
|
||||||
local ifname = intf['ifname']
|
local ifname = intf['ifname']
|
||||||
|
if ifname ~= nil then
|
||||||
local iw = iwinfo[iwinfo.type(ifname)]
|
local iw = iwinfo[iwinfo.type(ifname)]
|
||||||
local count = 0
|
local count = 0
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ local function scrape()
|
|||||||
metric_wifi_stations({ifname = ifname}, count)
|
metric_wifi_stations({ifname = ifname}, count)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return { scrape = scrape }
|
return { scrape = scrape }
|
||||||
|
|||||||
Reference in New Issue
Block a user