prometheus-node-exporter-lua: add bmx6/7 scraper
scrapes bmx6 status and connected links.
example output:
bmx6_status{id="qMp-LibreMesh-1706",version="BMX6-0.1-alpha",address="fd66:66:66:a:6670:2ff:fe3e:9d28"} 1
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 97
bmx6_link_txRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
node_scrape_collector_duration_seconds{collector="bmx6"} 0.0025260448455811
node_scrape_collector_success{collector="bmx6"} 1
scrapes bmx7 status and connected links.
example output:
bmx7_status{id="C68791D2",revision="3a52f89",name="smpl-18f4ce",address="fd70:c687:91d2:8ab3:1a88:6b14:bad0:2b18"} 1
bmx7_cpu_usage 0.7
bmx7_mem_usage 3204000
bmx7_link_rxRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 54000
bmx7_link_txRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 52729
node_scrape_collector_duration_seconds{collector="bmx7"} 0.0020999908447266
node_scrape_collector_success{collector="bmx7"} 1
prometheus-node-exporter-lua: bmx6/7 netjson format
adds labels called source and target to links instead of only the target
previously called "id".
Retrieving all *links* from prometheus now makes it easier to create
a valid netjson(.org) graph.
It's not feasible to use *instance* as *source* as for instance likely
the name is used for dns, instead of the ID. Using the *name* instead of
*id* for netjson linking results in a bad graph when two devices have
the same (default) hostname.
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
7 years ago prometheus-node-exporter-lua: add bmx6/7 scraper
scrapes bmx6 status and connected links.
example output:
bmx6_status{id="qMp-LibreMesh-1706",version="BMX6-0.1-alpha",address="fd66:66:66:a:6670:2ff:fe3e:9d28"} 1
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 97
bmx6_link_txRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
node_scrape_collector_duration_seconds{collector="bmx6"} 0.0025260448455811
node_scrape_collector_success{collector="bmx6"} 1
scrapes bmx7 status and connected links.
example output:
bmx7_status{id="C68791D2",revision="3a52f89",name="smpl-18f4ce",address="fd70:c687:91d2:8ab3:1a88:6b14:bad0:2b18"} 1
bmx7_cpu_usage 0.7
bmx7_mem_usage 3204000
bmx7_link_rxRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 54000
bmx7_link_txRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 52729
node_scrape_collector_duration_seconds{collector="bmx7"} 0.0020999908447266
node_scrape_collector_success{collector="bmx7"} 1
prometheus-node-exporter-lua: bmx6/7 netjson format
adds labels called source and target to links instead of only the target
previously called "id".
Retrieving all *links* from prometheus now makes it easier to create
a valid netjson(.org) graph.
It's not feasible to use *instance* as *source* as for instance likely
the name is used for dns, instead of the ID. Using the *name* instead of
*id* for netjson linking results in a bad graph when two devices have
the same (default) hostname.
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
7 years ago prometheus-node-exporter-lua: add bmx6/7 scraper
scrapes bmx6 status and connected links.
example output:
bmx6_status{id="qMp-LibreMesh-1706",version="BMX6-0.1-alpha",address="fd66:66:66:a:6670:2ff:fe3e:9d28"} 1
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_txRate{target="UPC-CN-C6-E104-Alix-Paul",source="qMp-LibreMesh-1706",dev="wlan1-adhoc_12"} 100
bmx6_link_rxRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 97
bmx6_link_txRate{target="UPC-CN-C6-E104-Turoffner",source="qMp-LibreMesh-1706",dev="wlan0-mesh_12"} 100
node_scrape_collector_duration_seconds{collector="bmx6"} 0.0025260448455811
node_scrape_collector_success{collector="bmx6"} 1
scrapes bmx7 status and connected links.
example output:
bmx7_status{id="C68791D2",revision="3a52f89",name="smpl-18f4ce",address="fd70:c687:91d2:8ab3:1a88:6b14:bad0:2b18"} 1
bmx7_cpu_usage 0.7
bmx7_mem_usage 3204000
bmx7_link_rxRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 54000
bmx7_link_txRate{target="F48239CD",dev="wlan0-mesh_13",source="C68791D2",name="smpl-07889a"} 52729
node_scrape_collector_duration_seconds{collector="bmx7"} 0.0020999908447266
node_scrape_collector_success{collector="bmx7"} 1
prometheus-node-exporter-lua: bmx6/7 netjson format
adds labels called source and target to links instead of only the target
previously called "id".
Retrieving all *links* from prometheus now makes it easier to create
a valid netjson(.org) graph.
It's not feasible to use *instance* as *source* as for instance likely
the name is used for dns, instead of the ID. Using the *name* instead of
*id* for netjson linking results in a bad graph when two devices have
the same (default) hostname.
Signed-off-by: Paul Spooren <spooren@informatik.uni-leipzig.de>
7 years ago |
|
- #
- # Copyright (C) 2013-2017 OpenWrt.org
- #
- include $(TOPDIR)/rules.mk
-
- PKG_NAME:=prometheus-node-exporter-lua
- PKG_VERSION:=2018.06.26
- PKG_RELEASE:=1
-
- PKG_MAINTAINER:=Christian Simon <simon@swine.de>
- PKG_LICENSE:=Apache-2.0
-
- include $(INCLUDE_DIR)/package.mk
-
- define Package/prometheus-node-exporter-lua/Default
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=Prometheus node exporter
- PKGARCH:=all
- endef
-
- define Package/prometheus-node-exporter-lua
- $(call Package/prometheus-node-exporter-lua/Default)
- DEPENDS:=+luasocket +lua
- endef
-
- define Package/prometheus-node-exporter-lua/conffiles
- /etc/config/prometheus-node-exporter-lua
- endef
-
- define Package/prometheus-node-exporter-lua/description
- Provides node metrics as Prometheus scraping endpoint.
-
- This service is a lightweight rewrite in LUA of the offical Prometheus node_exporter.
- endef
-
- define Package/prometheus-node-exporter-lua-nat_traffic
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (nat_traffic collector)
- DEPENDS:=prometheus-node-exporter-lua
- endef
-
- define Package/prometheus-node-exporter-lua-netstat
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (netstat collector)
- DEPENDS:=prometheus-node-exporter-lua
- endef
-
- define Package/prometheus-node-exporter-lua-wifi
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (wifi collector)
- DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
- endef
-
- define Package/prometheus-node-exporter-lua-wifi_stations
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (wifi_stations collector)
- DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
- endef
-
- define Package/prometheus-node-exporter-lua-bmx6
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (bmx6 links collector)
- DEPENDS:=prometheus-node-exporter-lua bmx6 +lua-cjson +bmx6-json
- endef
-
- define Package/prometheus-node-exporter-lua-bmx7
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (bmx7 links collector)
- DEPENDS:=prometheus-node-exporter-lua bmx7 +lua-cjson +bmx7-json
- endef
-
- define Package/prometheus-node-exporter-lua-textfile
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (textfile collector)
- DEPENDS:=prometheus-node-exporter-lua +luci-lib-nixio
- endef
-
- define Package/prometheus-node-exporter-lua-openwrt
- $(call Package/prometheus-node-exporter-lua/Default)
- TITLE+= (openwrt collector)
- endef
-
- Build/Compile=
-
- define Package/prometheus-node-exporter-lua/install
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_CONF) ./files/etc/config/prometheus-node-exporter-lua $(1)/etc/config/prometheus-node-exporter-lua
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/etc/init.d/prometheus-node-exporter-lua $(1)/etc/init.d/prometheus-node-exporter-lua
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) ./files/usr/bin/prometheus-node-exporter-lua $(1)/usr/bin/prometheus-node-exporter-lua
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/cpu.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/filefd.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/loadavg.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/meminfo.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netdev.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/time.lua $(1)/usr/lib/lua/prometheus-collectors/
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/uname.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-nat_traffic/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/nat_traffic.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-netstat/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netstat.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-wifi/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-wifi_stations/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi_stations.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-bmx6/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx6.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-bmx7/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx7.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-textfile/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/textfile.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- define Package/prometheus-node-exporter-lua-openwrt/install
- $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
- $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/openwrt.lua $(1)/usr/lib/lua/prometheus-collectors/
- endef
-
- $(eval $(call BuildPackage,prometheus-node-exporter-lua))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-netstat))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi_stations))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx7))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-textfile))
- $(eval $(call BuildPackage,prometheus-node-exporter-lua-openwrt))
|