local operstate = load(device, "operstate")
local ifalias = load(device, "ifalias")
metric_node_network.info({device = device, address = address, broadcast = broadcast, duplex = duplex, operstate = operstate, ifalias = ifalias}, 1)
- local speed = load(device, "speed")
- if speed ~= nil and tonumber(speed) >= 0 then
- metric_node_network.speed_bytes({device = device}, tonumber(speed)*1000*1000/8)
+ local speed = tonumber(load(device, "speed"))
+ if speed ~= nil and speed >= 0 then
+ metric_node_network.speed_bytes({device = device}, speed*1000*1000/8)
end
local file_to_metric = {
addr_assign_type = "address_assign_type",
type = "protocol_type",
}
for file, metric in pairs(file_to_metric) do
- local value = load(device, file)
+ local value = tonumber(load(device, file))
if value ~= nil then
- metric_node_network[metric]({device = device}, tonumber(value))
+ metric_node_network[metric]({device = device}, value)
end
end
end