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

Commit

Permalink
fix: error with no snmp received before timeout (#143)
Browse files Browse the repository at this point in the history
* fix: delete try/exception block from sending to HEC

* fix: add max_retries=1 to app.task

* fix: try raising exception in case of SNMPD not enabled

* fix: add log

* fix: bring back rpevious changes

* fix: add ignore_result to celery

* fix: bring back the original version of send_request method
  • Loading branch information
omrozowicz-splunk committed Oct 11, 2021
1 parent ed054f2 commit b50480f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions splunk_connect_for_snmp_poller/manager/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def sort_varbinds(varbind_list: list) -> VarbindCollection:


# TODO remove the debugging statement later
@app.task
@app.task(ignore_result=True)
def snmp_polling(ir_json: str, server_config, index, one_time_flag=False):
ir = InventoryRecord.from_json(ir_json)

Expand Down Expand Up @@ -212,7 +212,7 @@ async def snmp_polling_async(
*get_bulk_specific_parameters, *static_parameters, prepared_profile # type: ignore
)

except Exception as e:
logger.error(
f"Error occurred while executing SNMP polling for {host}, version={ir.version}, profile={ir.profile}: {e}"
except Exception:
logger.exception(
f"Error occurred while executing SNMP polling for {host}, version={ir.version}, profile={ir.profile}"
)

0 comments on commit b50480f

Please sign in to comment.