prometheus-node-exporter-lua: fix missing conntrack values
authorAlex Tomlins <alex@tomlins.org.uk>
Wed, 3 Apr 2019 20:08:11 +0000 (21:08 +0100)
committerEtienne Champetier <echampetier@anevia.com>
Fri, 16 Aug 2019 06:11:23 +0000 (23:11 -0700)
commitb03545e0bcd0c1df31f8cc524033112cb1a62d09
tree1ae45f1c77c27fa436f2d52f084ffd858d192b05
parent70bd5a36cdb3df2dd42429bab63d65d7e20efb02
prometheus-node-exporter-lua: fix missing conntrack values

If the /proc/sys/net/netfilter/nc_conntrack_* files are not present,
this exporter was outputting a blank value, which is invalid. These
files will not be present when using an image that doesn't include the
iptables and firewall packages (eg a minimal access-point type image).

This updates the collector to only output the metrics if the
corresponding /proc files are present.

Signed-off-by: Alex Tomlins <alex@tomlins.org.uk>
(cherry picked from commit 0100a2cb26c30ee091a259625b9496dd7805aaaa)
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/conntrack.lua