From 59e006254124c7a9e4629dc1bf3a5daf98073f20 Mon Sep 17 00:00:00 2001 From: Thomas Aldrian Date: Sat, 30 Dec 2023 22:45:15 +0000 Subject: [PATCH 1/4] new types Signed-off-by: Thomas Aldrian --- utils/collectd/files/lua-scripts/dsl.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/collectd/files/lua-scripts/dsl.lua b/utils/collectd/files/lua-scripts/dsl.lua index 4811a6d17c4328..e167522ad9ac6e 100644 --- a/utils/collectd/files/lua-scripts/dsl.lua +++ b/utils/collectd/files/lua-scripts/dsl.lua @@ -25,11 +25,11 @@ local line_vars = { }, { name = "satn", - type = "snr" + type = "gauge" }, { name = "latn", - type = "snr" + type = "gauge" }, { name = "attndr", @@ -65,6 +65,14 @@ local errors = { { name = "tx_retransmitted", type = "errors" + }, + { + name = "crc_p", + type = "errors" + }, + { + name = "crcp_p", + type = "errors" } } From 77a99918f7a71999dd0c54a9e391cbb57b722982 Mon Sep 17 00:00:00 2001 From: Thomas Aldrian Date: Sat, 30 Dec 2023 22:58:14 +0000 Subject: [PATCH 2/4] Neater names Signed-off-by: Thomas Aldrian --- utils/collectd/files/lua-scripts/dsl.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/utils/collectd/files/lua-scripts/dsl.lua b/utils/collectd/files/lua-scripts/dsl.lua index e167522ad9ac6e..1f00d9cba84da3 100644 --- a/utils/collectd/files/lua-scripts/dsl.lua +++ b/utils/collectd/files/lua-scripts/dsl.lua @@ -113,11 +113,17 @@ end local function get_values(hostname, variables, metrics, direction) for _, information in pairs(variables) do local name = information["name"] + local type = information["type"] if metrics and metrics[name] ~= nil then local value = metrics[name] - local metric = build_metric(name, direction) - if information["type"] == "bool" then + + if name = type then + local metric = direction + else + local metric = build_metric(name, direction) + end + if type == "bool" then if metrics[name] == true then value = 1 else @@ -128,7 +134,7 @@ local function get_values(hostname, variables, metrics, direction) local t = { host = host, plugin = 'dsl', - type = information["type"], + type = type, type_instance = metric, values = {value} } From 5498861021ccbb1ae8d0da000583b236e5816d27 Mon Sep 17 00:00:00 2001 From: Thomas Aldrian Date: Sat, 30 Dec 2023 23:05:44 +0000 Subject: [PATCH 3/4] add rx_uncorrected_protected and rx_corrected Signed-off-by: Thomas Aldrian --- utils/collectd/files/lua-scripts/dsl.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/collectd/files/lua-scripts/dsl.lua b/utils/collectd/files/lua-scripts/dsl.lua index 1f00d9cba84da3..105a8f0da2d17d 100644 --- a/utils/collectd/files/lua-scripts/dsl.lua +++ b/utils/collectd/files/lua-scripts/dsl.lua @@ -58,10 +58,18 @@ local errors = { name = "rx_corrupted", type = "errors" }, + { + name = "rx_uncorrected_protected", + type = "errors" + }, { name = "rx_retransmitted", type = "errors" }, + { + name = "rx_corrected", + type = "errors" + }, { name = "tx_retransmitted", type = "errors" From ca713a49ca9fd8c5799ab79884d6bd2109e67674 Mon Sep 17 00:00:00 2001 From: Thomas Aldrian Date: Mon, 1 Jan 2024 17:50:57 +0000 Subject: [PATCH 4/4] revert special snr case Signed-off-by: Thomas Aldrian --- utils/collectd/files/lua-scripts/dsl.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/utils/collectd/files/lua-scripts/dsl.lua b/utils/collectd/files/lua-scripts/dsl.lua index 105a8f0da2d17d..99d361ae617013 100644 --- a/utils/collectd/files/lua-scripts/dsl.lua +++ b/utils/collectd/files/lua-scripts/dsl.lua @@ -126,11 +126,7 @@ local function get_values(hostname, variables, metrics, direction) if metrics and metrics[name] ~= nil then local value = metrics[name] - if name = type then - local metric = direction - else - local metric = build_metric(name, direction) - end + local metric = build_metric(name, direction) if type == "bool" then if metrics[name] == true then value = 1