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:
Zoltan Haindrich 2019-10-04 15:43:50 +00:00 committed by Etienne Champetier
parent a3af4c3691
commit 7bec619f53
2 changed files with 58 additions and 54 deletions

View file

@ -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),
@ -39,5 +40,6 @@ local function scrape()
end
end
end
end
return { scrape = scrape }

View file

@ -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
@ -65,5 +66,6 @@ local function scrape()
end
end
end
end
return { scrape = scrape }