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)
committerAlex Tomlins <alex@tomlins.org.uk>
Wed, 3 Apr 2019 20:08:11 +0000 (21:08 +0100)
commit0100a2cb26c30ee091a259625b9496dd7805aaaa
tree19ddd8a6a16a9cfc8163283b5feba8b3b1fb54e2
parentbf3bb52c3f05fe5786f5cbb62f664580990c8927
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>
utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/conntrack.lua