Skip to content
This repository was archived by the owner on Dec 17, 2021. It is now read-only.

Commit c2c9a8f

Browse files
author
Addon Factory template
committed
feat(metrics): use each index of an array should be a splitby
1 parent 85a5f84 commit c2c9a8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

splunk_connect_for_snmp_mib_server/translator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,10 @@ def format_metric_data(self, var_bind):
350350
custom_translated_oid = self.custom_translator(oid)
351351

352352
# Construct metric data
353+
snmp_index = translated_oid.split(".")[-1]
354+
if snmp_index.isnumeric():
355+
metric_data["snmp_index"] = snmp_index
356+
translated_oid = translated_oid.removesuffix(f".{snmp_index}")
353357
metric_data[
354358
"metric_name"
355359
] = f'sc4snmp.{translated_oid.replace(".","_").replace("::", ".")}'

0 commit comments

Comments
 (0)