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

Commit 52a6812

Browse files
feat: implement support for multimetric data
1 parent a385665 commit 52a6812

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

splunk_connect_for_snmp_mib_server/mib_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def translator():
6262
var_bind = var_binds[0]
6363
result = json.dumps(self._translator.format_metric_data(var_bind))
6464
else:
65+
# when 'return_multimetric' variable is set up as 'True', mib server should return both metric and
66+
# non-metric representation of the result
6567
if return_multimetric == "True":
66-
logger.debug(f"inside return_multimetric")
6768
result_dict = self._translator.format_metric_data(var_binds[0])
6869
result_string = self._translator.format_trap_event(var_binds)
69-
logger.debug(f"meric: {result_dict} non_metric {result_string}")
7070
result = {'metric_name': result_dict['metric_name'], 'metric': json.dumps(result_dict),
7171
'non_metric': result_string}
7272
else:

splunk_connect_for_snmp_mib_server/translator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ def custom_translator(self, oid):
261261
def get_custom_translation_table(self):
262262
translation_table = {}
263263
logger.debug(f"cwd {os.getcwd()}")
264-
os.chdir('..')
265264
file_path = os.path.join(os.getcwd(), "lookups/custom_mib_string_table.csv")
266265
logger.debug(f"file_path {file_path}")
267266
with open(file_path) as files:

0 commit comments

Comments
 (0)