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

Commit

Permalink
feat: implement support for multimetric data
Browse files Browse the repository at this point in the history
  • Loading branch information
omrozowicz-splunk committed Aug 18, 2021
1 parent a385665 commit 52a6812
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions splunk_connect_for_snmp_mib_server/mib_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def translator():
var_bind = var_binds[0]
result = json.dumps(self._translator.format_metric_data(var_bind))
else:
# when 'return_multimetric' variable is set up as 'True', mib server should return both metric and
# non-metric representation of the result
if return_multimetric == "True":
logger.debug(f"inside return_multimetric")
result_dict = self._translator.format_metric_data(var_binds[0])
result_string = self._translator.format_trap_event(var_binds)
logger.debug(f"meric: {result_dict} non_metric {result_string}")
result = {'metric_name': result_dict['metric_name'], 'metric': json.dumps(result_dict),
'non_metric': result_string}
else:
Expand Down
1 change: 0 additions & 1 deletion splunk_connect_for_snmp_mib_server/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ def custom_translator(self, oid):
def get_custom_translation_table(self):
translation_table = {}
logger.debug(f"cwd {os.getcwd()}")
os.chdir('..')
file_path = os.path.join(os.getcwd(), "lookups/custom_mib_string_table.csv")
logger.debug(f"file_path {file_path}")
with open(file_path) as files:
Expand Down

0 comments on commit 52a6812

Please sign in to comment.