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.

104 lines
4.2 KiB

  1. #
  2. # Copyright (C) 2013-2017 OpenWrt.org
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=prometheus-node-exporter-lua
  6. PKG_VERSION:=2017.12.08
  7. PKG_RELEASE:=1
  8. PKG_MAINTAINER:=Christian Simon <simon@swine.de>
  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. Build/Compile=
  49. define Package/prometheus-node-exporter-lua/install
  50. $(INSTALL_DIR) $(1)/etc/config
  51. $(INSTALL_CONF) ./files/etc/config/prometheus-node-exporter-lua $(1)/etc/config/prometheus-node-exporter-lua
  52. $(INSTALL_DIR) $(1)/etc/init.d
  53. $(INSTALL_BIN) ./files/etc/init.d/prometheus-node-exporter-lua $(1)/etc/init.d/prometheus-node-exporter-lua
  54. $(INSTALL_DIR) $(1)/usr/bin
  55. $(INSTALL_BIN) ./files/usr/bin/prometheus-node-exporter-lua $(1)/usr/bin/prometheus-node-exporter-lua
  56. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  57. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/cpu.lua $(1)/usr/lib/lua/prometheus-collectors/
  58. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/filefd.lua $(1)/usr/lib/lua/prometheus-collectors/
  59. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/loadavg.lua $(1)/usr/lib/lua/prometheus-collectors/
  60. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/meminfo.lua $(1)/usr/lib/lua/prometheus-collectors/
  61. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netdev.lua $(1)/usr/lib/lua/prometheus-collectors/
  62. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/time.lua $(1)/usr/lib/lua/prometheus-collectors/
  63. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/uname.lua $(1)/usr/lib/lua/prometheus-collectors/
  64. endef
  65. define Package/prometheus-node-exporter-lua-nat_traffic/install
  66. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  67. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/nat_traffic.lua $(1)/usr/lib/lua/prometheus-collectors/
  68. endef
  69. define Package/prometheus-node-exporter-lua-netstat/install
  70. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  71. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/netstat.lua $(1)/usr/lib/lua/prometheus-collectors/
  72. endef
  73. define Package/prometheus-node-exporter-lua-wifi/install
  74. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  75. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi.lua $(1)/usr/lib/lua/prometheus-collectors/
  76. endef
  77. define Package/prometheus-node-exporter-lua-wifi_stations/install
  78. $(INSTALL_DIR) $(1)/usr/lib/lua/prometheus-collectors
  79. $(INSTALL_BIN) ./files/usr/lib/lua/prometheus-collectors/wifi_stations.lua $(1)/usr/lib/lua/prometheus-collectors/
  80. endef
  81. $(eval $(call BuildPackage,prometheus-node-exporter-lua))
  82. $(eval $(call BuildPackage,prometheus-node-exporter-lua-nat_traffic))
  83. $(eval $(call BuildPackage,prometheus-node-exporter-lua-netstat))
  84. $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi))
  85. $(eval $(call BuildPackage,prometheus-node-exporter-lua-wifi_stations))