Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] collectd: minor dsl lua script changes #23011

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions utils/collectd/files/lua-scripts/dsl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ local line_vars = {
},
{
name = "satn",
type = "snr"
type = "gauge"
},
{
name = "latn",
type = "snr"
type = "gauge"
},
{
name = "attndr",
Expand Down Expand Up @@ -58,13 +58,29 @@ 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"
},
{
name = "crc_p",
type = "errors"
},
{
name = "crcp_p",
type = "errors"
}
}

Expand Down Expand Up @@ -105,11 +121,13 @@ 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 type == "bool" then
if metrics[name] == true then
value = 1
else
Expand All @@ -120,7 +138,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}
}
Expand Down