Browse Source

Merge pull request #13544 from PolynomialDivision/feature/updatdawnexporter

prometheus-node-exporter-lua: update dawn exporter
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
5d1127b7fe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 3 deletions
  1. +13
    -1
      utils/prometheus-node-exporter-lua/Makefile
  2. +3
    -2
      utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua

+ 13
- 1
utils/prometheus-node-exporter-lua/Makefile View File

@ -4,7 +4,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=prometheus-node-exporter-lua PKG_NAME:=prometheus-node-exporter-lua
PKG_VERSION:=2020.07.04
PKG_VERSION:=2020.10.01
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com> 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/ $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx7.lua $(1)/usr/lib/lua/prometheus-collectors/
endef 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 define Package/prometheus-node-exporter-lua-hostapd_stations
$(call Package/prometheus-node-exporter-lua/Default) $(call Package/prometheus-node-exporter-lua/Default)
TITLE+= (hostapd_stations collector) - Requires a full hostapd / wpad build 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))
$(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6))
$(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx7)) $(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-hostapd_stations))
$(eval $(call BuildPackage,prometheus-node-exporter-lua-ltq-dsl)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-ltq-dsl))
$(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic)) $(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic))


+ 3
- 2
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/dawn.lua View File

@ -20,6 +20,7 @@ local function scrape()
ssid = ssid, ssid = ssid,
bssid = ap, bssid = ap,
freq = ap_table['freq'], freq = ap_table['freq'],
hostname = ap_table['hostname'],
ht_support = ht_support, ht_support = ht_support,
vht_support = vht_support, vht_support = vht_support,
neighbor_report = ap_table['neighbor_report'], 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_vht_support = (client_table['vht'] == true) and 1 or 0
local client_signal = client_table['signal'] or -255 local client_signal = client_table['signal'] or -255
local labels = {
local labels_client_signal = {
ssid = ssid, ssid = ssid,
bssid = ap, bssid = ap,
mac = client, mac = client,
ht_support = client_ht_support, ht_support = client_ht_support,
vht_support = client_vht_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 end
end end


Loading…
Cancel
Save