aboutsummaryrefslogtreecommitdiff
path: root/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/conntrack.lua
blob: 1abb7a19136edc5722a1d7f0ecc3755c454107bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
local function scrape()
  local count = get_contents("/proc/sys/net/netfilter/nf_conntrack_count")
  local max = get_contents("/proc/sys/net/netfilter/nf_conntrack_max")
  if count ~= "" then
    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

return { scrape = scrape }