include $(TOPDIR)/rules.mk
PKG_NAME:=prometheus-node-exporter-lua
-PKG_VERSION:=2018.06.26
+PKG_VERSION:=2018.07.23
PKG_RELEASE:=1
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
define Package/prometheus-node-exporter-lua-openwrt
$(call Package/prometheus-node-exporter-lua/Default)
TITLE+= (openwrt collector)
+ DEPENDS:=prometheus-node-exporter-lua
endef
Build/Compile=
$(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/conntrack.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/
--- /dev/null
+local function scrape()
+ metric("node_nf_conntrack_entries", "gauge", nil,
+ string.sub(get_contents("/proc/sys/net/netfilter/nf_conntrack_count"), 1, -2))
+ metric("node_nf_conntrack_entries_limit", "gauge", nil,
+ string.sub(get_contents("/proc/sys/net/netfilter/nf_conntrack_max"), 1, -2))
+end
+
+return { scrape = scrape }