Skip to content

Commit

Permalink
prometheus-node-exporter-lua: fix
Browse files Browse the repository at this point in the history
uhttpd: /usr/lib/lua/prometheus-collectors/uci_dhcp_host.lua:9:
        bad argument openwrt#1 to 'upper' (string expected, got nil)

Signed-off-by: Javier Marcet <[email protected]>
  • Loading branch information
jmarcet committed Aug 16, 2024
1 parent 062e149 commit 2325b85
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local function scrape()
local metric_uci_host = metric("uci_dhcp_host", "gauge")

curs:foreach("dhcp", "host", function(s)
if s[".type"] == "host" then
if s[".type"] == "host" and s["mac"] and s["dns"] and s["ip"] then
labels = {name=s["name"], mac=string.upper(s["mac"]), dns=s["dns"], ip=s["ip"]}
metric_uci_host(labels, 1)
end
Expand Down

0 comments on commit 2325b85

Please sign in to comment.