diff options
author | Nick Hainke <vincent@systemli.org> | 2020-10-01 22:19:07 +0200 |
---|---|---|
committer | Nick Hainke vincent@systemli.org <vincent@systemli.org> | 2020-10-07 13:54:23 +0200 |
commit | 8dfd1bc59ada594c078eaf1b8b6c61e4db3d5394 (patch) | |
tree | d5d90d27bd7b7a6fd41961dc8751ee5eee54875c /utils/prometheus-node-exporter-lua | |
parent | 77adfcac25549d3a0dad3b7f101f3478403e0660 (diff) |
prometheus-node-exporter-lua: update dawn exporter
Add dawn exporter to Makefile.
Add hostname to export.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Diffstat (limited to 'utils/prometheus-node-exporter-lua')
-rw-r--r-- | utils/prometheus-node-exporter-lua/Makefile | 14 | ||||
-rw-r--r-- | utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua | 5 |
2 files changed, 16 insertions, 3 deletions
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 <champetier.etienne@gmail.com> @@ -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 |