Browse Source

prometheus-node-exporter-lua: Added entropy.lua.

Signed-off-by: Jonathan Davies <jpds@protonmail.com>
lilik-openwrt-22.03
Jonathan Davies 3 years ago
committed by Etienne Champetier
parent
commit
80fe862fc3
2 changed files with 11 additions and 1 deletions
  1. +2
    -1
      utils/prometheus-node-exporter-lua/Makefile
  2. +9
    -0
      utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/entropy.lua

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

@ -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 <champetier.etienne@gmail.com>
@ -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/


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

@ -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 }

Loading…
Cancel
Save