Skip to content
Snippets Groups Projects
Commit 3599e1bd authored by Pelle Koster's avatar Pelle Koster
Browse files

FIX: counters must be floats to be compatible with sensu influx handler

parent f3b8f645
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,9 @@ NCCLIENT_PARAMS = { ...@@ -17,7 +17,9 @@ NCCLIENT_PARAMS = {
} }
PHYSICAL_INTERFACE_COUNTERS = { PHYSICAL_INTERFACE_COUNTERS = {
"__defaults__": {"transform": int, "required": False}, # Counters must be floats to be compatible with influx writing to the same
# measurement. cf https://github.com/sensu/sensu-go/issues/2213
"__defaults__": {"transform": float, "required": False},
"name": {"path": "./name", "transform": lambda v: str(v).strip()}, "name": {"path": "./name", "transform": lambda v: str(v).strip()},
"brian": { "brian": {
"ingressOctets": {"path": "./traffic-statistics/input-bytes", "required": True}, "ingressOctets": {"path": "./traffic-statistics/input-bytes", "required": True},
...@@ -90,7 +92,9 @@ PHYSICAL_INTERFACE_COUNTERS = { ...@@ -90,7 +92,9 @@ PHYSICAL_INTERFACE_COUNTERS = {
LOGICAL_INTERFACE_COUNTERS = { LOGICAL_INTERFACE_COUNTERS = {
"__defaults__": {"transform": int, "required": False}, # Counters must be floats to be compatible with influx writing to the same
# measurement. cf https://github.com/sensu/sensu-go/issues/2213
"__defaults__": {"transform": float, "required": False},
"name": {"path": "./name", "transform": lambda v: str(v).strip()}, "name": {"path": "./name", "transform": lambda v: str(v).strip()},
"brian": { "brian": {
"ingressOctets": { "ingressOctets": {
......
...@@ -19,7 +19,9 @@ NCCLIENT_PARAMS = { ...@@ -19,7 +19,9 @@ NCCLIENT_PARAMS = {
} }
INTERFACE_COUNTERS = { INTERFACE_COUNTERS = {
"__defaults__": {"transform": int, "required": False}, # Counters must be floats to be compatible with influx writing to the same
# measurement. cf https://github.com/sensu/sensu-go/issues/2213
"__defaults__": {"transform": float, "required": False},
"name": { "name": {
"path": ["./lag-name", "./port-id"], "path": ["./lag-name", "./port-id"],
"transform": lambda v: str(v).strip(), "transform": lambda v: str(v).strip(),
...@@ -45,7 +47,9 @@ INTERFACE_COUNTERS = { ...@@ -45,7 +47,9 @@ INTERFACE_COUNTERS = {
} }
INTERFACE_COUNTERS_ALT = { INTERFACE_COUNTERS_ALT = {
"__defaults__": {"transform": int, "required": False}, # Counters must be floats to be compatible with influx writing to the same
# measurement. cf https://github.com/sensu/sensu-go/issues/2213
"__defaults__": {"transform": float, "required": False},
"name": { "name": {
"path": "./interface-name", "path": "./interface-name",
"transform": lambda v: str(v).strip(), "transform": lambda v: str(v).strip(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment