diff --git a/utils/prometheus-node-exporter-ucode/Makefile b/utils/prometheus-node-exporter-ucode/Makefile index d91b8663b5..961f4c7445 100644 --- a/utils/prometheus-node-exporter-ucode/Makefile +++ b/utils/prometheus-node-exporter-ucode/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=prometheus-node-exporter-ucode PKG_VERSION:=2024.02.07 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_MAINTAINER:=Andre Heider PKG_LICENSE:=Apache-2.0 diff --git a/utils/prometheus-node-exporter-ucode/files/extra/wifi.uc b/utils/prometheus-node-exporter-ucode/files/extra/wifi.uc index fb46b55091..20d5ea98bb 100644 --- a/utils/prometheus-node-exporter-ucode/files/extra/wifi.uc +++ b/utils/prometheus-node-exporter-ucode/files/extra/wifi.uc @@ -68,11 +68,16 @@ for (let radio in x) { let bitrate = 0; const stations = length(wsta) || 0; if (stations) { + let rated = 0; for (let sta in wsta) { signal += sta["sta_info"].signal; - bitrate += sta["sta_info"]["tx_bitrate"].bitrate32; + const br = sta["sta_info"]["tx_bitrate"]?.bitrate32; + if (br) { + bitrate += br; + rated++; + } } - bitrate /= stations * 0.01; + bitrate = rated ? bitrate / (rated * 0.01) : 0; signal /= stations; }