You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
6.8 KiB

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
  1. #
  2. # Copyright (C) 2013-2017 OpenWrt.org
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=prometheus-node-exporter-lua
  6. PKG_VERSION:=2018.12.30
  7. PKG_RELEASE:=4
  8. PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
  9. PKG_LICENSE:=Apache-2.0
  10. include $(INCLUDE_DIR)/package.mk
  11. define Package/prometheus-node-exporter-lua/Default
  12. SECTION:=utils
  13. CATEGORY:=Utilities
  14. TITLE:=Prometheus node exporter
  15. PKGARCH:=all
  16. endef
  17. define Package/prometheus-node-exporter-lua
  18. $(call Package/prometheus-node-exporter-lua/Default)
  19. DEPENDS:=+luasocket +lua
  20. endef
  21. define Package/prometheus-node-exporter-lua/conffiles
  22. /etc/config/prometheus-node-exporter-lua
  23. endef
  24. define Package/prometheus-node-exporter-lua/description
  25. Provides node metrics as Prometheus scraping endpoint.
  26. This service is a lightweight rewrite in LUA of the offical Prometheus node_exporter.
  27. endef
  28. define Package/prometheus-node-exporter-lua-nat_traffic
  29. $(call Package/prometheus-node-exporter-lua/Default)
  30. TITLE+= (nat_traffic collector)
  31. DEPENDS:=prometheus-node-exporter-lua
  32. endef
  33. define Package/prometheus-node-exporter-lua-netstat
  34. $(call Package/prometheus-node-exporter-lua/Default)
  35. TITLE+= (netstat collector)
  36. DEPENDS:=prometheus-node-exporter-lua
  37. endef
  38. define Package/prometheus-node-exporter-lua-wifi
  39. $(call Package/prometheus-node-exporter-lua/Default)
  40. TITLE+= (wifi collector)
  41. DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
  42. endef
  43. define Package/prometheus-node-exporter-lua-wifi_stations
  44. $(call Package/prometheus-node-exporter-lua/Default)
  45. TITLE+= (wifi_stations collector)
  46. DEPENDS:=prometheus-node-exporter-lua +libiwinfo-lua +libubus-lua
  47. endef
  48. define Package/prometheus-node-exporter-lua-bmx6
  49. $(call Package/prometheus-node-exporter-lua/Default)
  50. TITLE+= (bmx6 links collector)
  51. DEPENDS:=prometheus-node-exporter-lua bmx6 +lua-cjson +bmx6-json
  52. endef
  53. define Package/prometheus-node-exporter-lua-bmx7
  54. $(call Package/prometheus-node-exporter-lua/Default)
  55. TITLE+= (bmx7 links collector)
  56. DEPENDS:=prometheus-node-exporter-lua bmx7 +lua-cjson +bmx7-json
  57. endef
  58. define Package/prometheus-node-exporter-lua-textfile
  59. $(call Package/prometheus-node-exporter-lua/Default)
  60. TITLE+= (textfile collector)
  61. DEPENDS:=prometheus-node-exporter-lua +luci-lib-nixio
  62. endef
  63. define Package/prometheus-node-exporter-lua-openwrt
  64. $(call Package/prometheus-node-exporter-lua/Default)
  65. TITLE+= (openwrt collector)
  66. DEPENDS:=prometheus-node-exporter-lua
  67. endef
  68. define Package/prometheus-node-exporter-lua-ltq-dsl
  69. $(call Package/prometheus-node-exporter-lua/Default)
  70. TITLE+= (lantiq dsl collector)
  71. DEPENDS:=prometheus-node-exporter-lua @(PACKAGE_ltq-adsl-app||PACKAGE_ltq-vdsl-app)
  72. endef
  73. Build/Compile=
  74. define Package/prometheus-node-exporter-lua/install
  75. $(INSTALL_DIR) $(1)/etc/config
  76. $(INSTALL_CONF) ./files/etc/config/prometheus-node-exporter-lua $(1)/etc/config/prometheus-node-exporter-lua
  77. $(INSTALL_DIR) $(1)/etc/init.d
  78. $(INSTALL_BIN) ./files/etc/init.d/prometheus-node-exporter-lua $(1)/etc/init.d/prometheus-node-exporter-lua
  79. $(INSTALL_DIR) $(1)/usr/bin
  80. $(INSTALL_BIN) ./files/usr/bin/prometheus-node-exporter-lua $(1)/usr/bin/prometheus-node-exporter-lua
  81. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  82. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/cpu.lua $(1)/usr/lib/lua/prometheus-collectors/
  83. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/conntrack.lua $(1)/usr/lib/lua/prometheus-collectors/
  84. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/filefd.lua $(1)/usr/lib/lua/prometheus-collectors/
  85. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/loadavg.lua $(1)/usr/lib/lua/prometheus-collectors/
  86. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/meminfo.lua $(1)/usr/lib/lua/prometheus-collectors/
  87. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netdev.lua $(1)/usr/lib/lua/prometheus-collectors/
  88. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/time.lua $(1)/usr/lib/lua/prometheus-collectors/
  89. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/uname.lua $(1)/usr/lib/lua/prometheus-collectors/
  90. endef
  91. define Package/prometheus-node-exporter-lua-nat_traffic/install
  92. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  93. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/nat_traffic.lua $(1)/usr/lib/lua/prometheus-collectors/
  94. endef
  95. define Package/prometheus-node-exporter-lua-netstat/install
  96. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  97. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netstat.lua $(1)/usr/lib/lua/prometheus-collectors/
  98. endef
  99. define Package/prometheus-node-exporter-lua-wifi/install
  100. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  101. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi.lua $(1)/usr/lib/lua/prometheus-collectors/
  102. endef
  103. define Package/prometheus-node-exporter-lua-wifi_stations/install
  104. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  105. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi_stations.lua $(1)/usr/lib/lua/prometheus-collectors/
  106. endef
  107. define Package/prometheus-node-exporter-lua-bmx6/install
  108. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  109. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx6.lua $(1)/usr/lib/lua/prometheus-collectors/
  110. endef
  111. define Package/prometheus-node-exporter-lua-bmx7/install
  112. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  113. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/bmx7.lua $(1)/usr/lib/lua/prometheus-collectors/
  114. endef
  115. define Package/prometheus-node-exporter-lua-textfile/install
  116. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  117. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/textfile.lua $(1)/usr/lib/lua/prometheus-collectors/
  118. endef
  119. define Package/prometheus-node-exporter-lua-openwrt/install
  120. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  121. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/openwrt.lua $(1)/usr/lib/lua/prometheus-collectors/
  122. endef
  123. define Package/prometheus-node-exporter-lua-ltq-dsl/install
  124. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  125. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/ltq-dsl.lua $(1)/usr/lib/lua/prometheus-collectors/
  126. endef
  127. $(eval $(call BuildPackage,prometheus-node-exporter-lua))
  128. $(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic))
  129. $(eval $(call BuildPackage,prometheus-node-exporter-lua-netstat))
  130. $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi))
  131. $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi_stations))
  132. $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx6))
  133. $(eval $(call BuildPackage,prometheus-node-exporter-lua-bmx7))
  134. $(eval $(call BuildPackage,prometheus-node-exporter-lua-textfile))
  135. $(eval $(call BuildPackage,prometheus-node-exporter-lua-openwrt))
  136. $(eval $(call BuildPackage,prometheus-node-exporter-lua-ltq-dsl))