diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile index 434ea95b6..371d2f776 100644 --- a/utils/prometheus-node-exporter-lua/Makefile +++ b/utils/prometheus-node-exporter-lua/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=prometheus-node-exporter-lua -PKG_VERSION:=2020.07.04 +PKG_VERSION:=2020.10.01 PKG_RELEASE:=1 PKG_MAINTAINER:=Etienne CHAMPETIER @@ -78,6 +78,17 @@ define Package/prometheus-node-exporter-lua-bmx7/install $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx7.lua $(1)/usr/lib/lua/prometheus-collectors/ endef +define Package/prometheus-node-exporter-lua-dawn + $(call Package/prometheus-node-exporter-lua/Default) + TITLE+= (dawn collector) + DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua +endef + +define Package/prometheus-node-exporter-lua-dawn/install + $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors + $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/dawn.lua $(1)/usr/lib/lua/prometheus-collectors/ +endef + define Package/prometheus-node-exporter-lua-hostapd_stations $(call Package/prometheus-node-exporter-lua/Default) TITLE+= (hostapd_stations collector) - Requires a full hostapd / wpad build @@ -180,6 +191,7 @@ endef $(eval $(call BuildPackage,prometheus-node-exporter-lua)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx7)) +$(eval $(call BuildPackage,prometheus-node-exporter-lua-dawn)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-hostapd_stations)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-ltq-dsl)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic)) diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua index 96944632f..8c3c4d273 100644 --- a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua +++ b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua @@ -20,6 +20,7 @@ local function scrape() ssid = ssid, bssid = ap, freq = ap_table['freq'], + hostname = ap_table['hostname'], ht_support = ht_support, vht_support = vht_support, neighbor_report = ap_table['neighbor_report'], @@ -34,14 +35,14 @@ local function scrape() local client_vht_support = (client_table['vht'] == true) and 1 or 0 local client_signal = client_table['signal'] or -255 - local labels = { + local labels_client_signal = { ssid = ssid, bssid = ap, mac = client, ht_support = client_ht_support, vht_support = client_vht_support, } - metric_dawn_station_signal_dbm(labels, client_signal) + metric_dawn_station_signal_dbm(labels_client_signal, client_signal) end end end