|
| 1 | +# Copyright (C) 2013-2017 OpenWrt.org |
| 2 | + |
| 3 | +include $(TOPDIR)/rules.mk |
| 4 | + |
| 5 | +PKG_NAME:=prometheus-node-exporter-ucode |
| 6 | +<<<<<<< Updated upstream |
| 7 | +PKG_VERSION:=2024.02.07 |
| 8 | +PKG_RELEASE:=2 |
| 9 | +======= |
| 10 | +PKG_VERSION:=2025.12.04 |
| 11 | +PKG_RELEASE:=1 |
| 12 | +>>>>>>> Stashed changes |
| 13 | + |
| 14 | +PKG_MAINTAINER:=Andre Heider <a.heider@gmail.com> |
| 15 | +PKG_LICENSE:=Apache-2.0 |
| 16 | + |
| 17 | +include $(INCLUDE_DIR)/package.mk |
| 18 | + |
| 19 | +Build/Compile= |
| 20 | + |
| 21 | +define Package/$(PKG_NAME)/Default |
| 22 | + SECTION:=utils |
| 23 | + CATEGORY:=Utilities |
| 24 | + TITLE:=Prometheus node exporter |
| 25 | + PKGARCH:=all |
| 26 | +endef |
| 27 | + |
| 28 | +define Package/$(PKG_NAME) |
| 29 | + $(call Package/$(PKG_NAME)/Default) |
| 30 | + DEPENDS:=+uhttpd +uhttpd-mod-ucode +rpcd +ucode-mod-fs +ucode-mod-ubus |
| 31 | +endef |
| 32 | + |
| 33 | +define Package/$(PKG_NAME)/install |
| 34 | + $(INSTALL_DIR) $(1)/etc/config |
| 35 | + $(INSTALL_CONF) ./files/config $(1)/etc/config/$(PKG_NAME) |
| 36 | + $(INSTALL_DIR) $(1)/etc/init.d |
| 37 | + $(INSTALL_BIN) ./files/init $(1)/etc/init.d/$(PKG_NAME) |
| 38 | + $(INSTALL_DIR) $(1)/usr/share/ucode/node-exporter/lib |
| 39 | + $(INSTALL_DATA) ./files/metrics.uc $(1)/usr/share/ucode/node-exporter/ |
| 40 | + $(INSTALL_DATA) ./files/base/*.uc $(1)/usr/share/ucode/node-exporter/lib/ |
| 41 | + $(INSTALL_DIR) $(1)/usr/bin |
| 42 | + $(INSTALL_BIN) ./files/run.sh $(1)/usr/bin/$(PKG_NAME) |
| 43 | +endef |
| 44 | + |
| 45 | +define Package/$(PKG_NAME)/conffiles |
| 46 | +/etc/config/$(PKG_NAME) |
| 47 | +endef |
| 48 | + |
| 49 | +define Package/$(PKG_NAME)/description |
| 50 | + Provides node metrics as Prometheus scraping endpoint. |
| 51 | + |
| 52 | + This service is a lightweight rewrite in ucode of the official Prometheus node_exporter. |
| 53 | +endef |
| 54 | + |
| 55 | +$(eval $(call BuildPackage,prometheus-node-exporter-ucode)) |
| 56 | + |
| 57 | +define Collector |
| 58 | + define Package/$(PKG_NAME)-$(1) |
| 59 | + $$(call Package/$(PKG_NAME)/Default) |
| 60 | + TITLE+= ($(2)) |
| 61 | + DEPENDS:=$(PKG_NAME) $(3) |
| 62 | + endef |
| 63 | + |
| 64 | + define Package/$(PKG_NAME)-$(1)/install |
| 65 | + $$(INSTALL_DIR) $$(1)/usr/share/ucode/node-exporter/lib |
| 66 | + $$(INSTALL_DATA) ./files/extra/$(1).uc $$(1)/usr/share/ucode/node-exporter/lib/ |
| 67 | + endef |
| 68 | + |
| 69 | + $$(eval $$(call BuildPackage,$(PKG_NAME)-$(1))) |
| 70 | +endef |
| 71 | + |
| 72 | +$(eval $(call Collector,dnsmasq,Dnsmasq collector,@dnsmasq)) |
| 73 | +$(eval $(call Collector,hwmon,hwmon collector,)) |
| 74 | +$(eval $(call Collector,ltq-dsl,Lantiq/Intel/MaxLinear DSL collector,@ltq-dsl-app)) |
| 75 | +$(eval $(call Collector,netstat,netstat collector,)) |
| 76 | +$(eval $(call Collector,odhcp6c,odhcp6c statistics collector,@odhcp6c)) |
| 77 | +$(eval $(call Collector,openwrt,OpenWrt collector,)) |
| 78 | +$(eval $(call Collector,realtek-poe,RealTek PoE collector,@realtek-poe)) |
| 79 | +$(eval $(call Collector,snmp6,snmp6 collector,)) |
| 80 | +$(eval $(call Collector,thermal,thermal collector,)) |
| 81 | +$(eval $(call Collector,uci_dhcp_host,UCI DHCP host collector,)) |
| 82 | +$(eval $(call Collector,wifi,Wi-Fi collector,+ucode-mod-nl80211)) |
| 83 | +$(eval $(call Collector,wireguard,Wireguard collector,+rpcd-mod-wireguard)) |
0 commit comments