aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2018-06-17 17:01:57 +0900
committerPaul Spooren <mail@aparcar.org>2018-06-17 17:07:36 +0900
commitfc44f87dc52b2a35a2a234c26ec88a7fa6beb7f2 (patch)
tree9ee2a6af4a5402b3c9475594cd975303163b40a7 /utils
parent870ebb1b8db9ac33ad0c3bf9c495b78f9617adb1 (diff)
prometheus-node-exporter-lua: handle fancy release
Some releases may have non letters in it's name currently resulting in an empty ("") output which is then discarded, resulting in *missing* labels in the metric. Now it uses `.-` to catch as little as possible, but anything. Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'utils')
-rw-r--r--utils/prometheus-node-exporter-lua/Makefile2
-rw-r--r--utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/utils/prometheus-node-exporter-lua/Makefile b/utils/prometheus-node-exporter-lua/Makefile
index 0c2fa8485..5aa4cf8a2 100644
--- a/utils/prometheus-node-exporter-lua/Makefile
+++ b/utils/prometheus-node-exporter-lua/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=prometheus-node-exporter-lua
PKG_VERSION:=2017.12.08
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_MAINTAINER:=Christian Simon <simon@swine.de>
PKG_LICENSE:=Apache-2.0
diff --git a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua
index 2f5030d7a..8b9785a27 100644
--- a/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua
+++ b/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/openwrt.lua
@@ -6,7 +6,7 @@ local labels = {
board_name = string.sub(get_contents("/tmp/sysinfo/board_name"), 1, -2)
}
-for k, v in string.gmatch(get_contents("/etc/openwrt_release"), "(DISTRIB_%w+)='(%w+)'\n") do
+for k, v in string.gmatch(get_contents("/etc/openwrt_release"), "(DISTRIB_%w+)='(.-)'\n") do
if k == "DISTRIB_ID" then
labels["id"] = v
elseif k == "DISTRIB_RELEASE" then