Browse Source

prometheus-node-exporter-lua: add conntrack collector

Also fix missing dependency of openwrt collector

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
lilik-openwrt-22.03
Etienne Champetier 6 years ago
parent
commit
b584443d65
2 changed files with 11 additions and 1 deletions
  1. +3
    -1
      utils/prometheus-node-exporter-lua/Makefile
  2. +8
    -0
      utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/conntrack.lua

+ 3
- 1
utils/prometheus-node-exporter-lua/Makefile View File

@ -4,7 +4,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=prometheus-node-exporter-lua PKG_NAME:=prometheus-node-exporter-lua
PKG_VERSION:=2018.06.26
PKG_VERSION:=2018.07.23
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com> PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
@ -79,6 +79,7 @@ endef
define Package/prometheus-node-exporter-lua-openwrt define Package/prometheus-node-exporter-lua-openwrt
$(call Package/prometheus-node-exporter-lua/Default) $(call Package/prometheus-node-exporter-lua/Default)
TITLE+= (openwrt collector) TITLE+= (openwrt collector)
DEPENDS:=prometheus-node-exporter-lua
endef endef
Build/Compile= Build/Compile=
@ -92,6 +93,7 @@ define Package/prometheus-node-exporter-lua/install
$(INSTALL_BIN) ./files/usr/bin/prometheus-node-exporter-lua $(1)/usr/bin/prometheus-node-exporter-lua $(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_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/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/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/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/meminfo.lua $(1)/usr/lib/lua/prometheus-collectors/


+ 8
- 0
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/conntrack.lua View File

@ -0,0 +1,8 @@
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 }

Loading…
Cancel
Save