Skip to content

Commit 8baac34

Browse files
author
Anze
committed
Avoid error in logs if no results can be sent; warning only
1 parent bdde49b commit 8baac34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

snmpcollector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def _apply_expression_to_results(snmp_results, methods, expression, output_path)
128128
def send_results_to_grafolean(backend_url, bot_token, account_id, values):
129129
url = '{}/accounts/{}/values/?b={}'.format(backend_url, account_id, bot_token)
130130

131+
if len(values) == 0:
132+
log.warning("No results available to be sent to Grafolean, skipping.")
133+
return
134+
131135
log.info("Sending results to Grafolean")
132136
try:
133137
r = requests.post(url, json=values)

0 commit comments

Comments
 (0)