mirror of
https://git.openwrt.org/feed/packages.git
synced 2024-06-17 21:03:56 +02:00
Merge pull request #8586 from alext/fix_conntrack_collector
prometheus-node-exporter-lua: fix missing conntrack values
This commit is contained in:
commit
a5d85b71ac
|
@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=prometheus-node-exporter-lua
|
PKG_NAME:=prometheus-node-exporter-lua
|
||||||
PKG_VERSION:=2018.12.30
|
PKG_VERSION:=2018.12.30
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
|
|
||||||
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
|
PKG_MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
local function scrape()
|
local function scrape()
|
||||||
metric("node_nf_conntrack_entries", "gauge", nil,
|
local count = get_contents("/proc/sys/net/netfilter/nf_conntrack_count")
|
||||||
string.sub(get_contents("/proc/sys/net/netfilter/nf_conntrack_count"), 1, -2))
|
local max = get_contents("/proc/sys/net/netfilter/nf_conntrack_max")
|
||||||
metric("node_nf_conntrack_entries_limit", "gauge", nil,
|
if count ~= "" then
|
||||||
string.sub(get_contents("/proc/sys/net/netfilter/nf_conntrack_max"), 1, -2))
|
metric("node_nf_conntrack_entries", "gauge", nil, string.sub(count, 1, -2))
|
||||||
|
end
|
||||||
|
if max ~= "" then
|
||||||
|
metric("node_nf_conntrack_entries_limit", "gauge", nil, string.sub(max, 1, -2))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return { scrape = scrape }
|
return { scrape = scrape }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user