From 80fe862fc31684802fb6bd9545af54a1a5cc7af0 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sun, 19 Dec 2021 01:35:11 +0000 Subject: [PATCH] prometheus-node-exporter-lua: Added entropy.lua. Signed-off-by: Jonathan Davies --- utils/prometheus-node-exporter-lua/Makefile | 3 ++- .../files/usr/lib/lua/prometheus-collectors/entropy.lua | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/entropy.lua diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile index b0c8783fe..6eb8d0ba6 100644 --- a/utils/prometheus-node-exporter-lua/Makefile +++ b/utils/prometheus-node-exporter-lua/Makefile @@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=prometheus-node-exporter-lua -PKG_VERSION:=2021.10.31 +PKG_VERSION:=2021.12.21 PKG_RELEASE:=1 PKG_MAINTAINER:=Etienne CHAMPETIER @@ -36,6 +36,7 @@ define Package/prometheus-node-exporter-lua/install $(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/entropy.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/ diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/entropy.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/entropy.lua new file mode 100644 index 000000000..b3ad62169 --- /dev/null +++ b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/entropy.lua @@ -0,0 +1,9 @@ +local function scrape() + local available_bits = get_contents("/proc/sys/kernel/random/entropy_avail") + local pool_size_bits = get_contents("/proc/sys/kernel/random/poolsize") + + metric("node_entropy_available_bits", "gauge", nil, available_bits) + metric("node_entropy_pool_size_bits", "gauge", nil, pool_size_bits) +end + +return { scrape = scrape }