Skip to content

Commit

Permalink
[chores] Log non-zero exit code warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryamanz29 committed Jun 24, 2022
1 parent 07aa783 commit 4bf1fd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion openwisp_monitoring/check/classes/iperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def check(self, store=True):
f'DeviceConnection is not properly set for "{device}", iperf check skipped!'
)
return
device_connection.connect()
# The DeviceConnection could fail if the management tunnel is down.
if not device_connection.connect():
logger.warning(
Expand All @@ -40,6 +39,9 @@ def check(self, store=True):
command, raise_unexpected_exit=False
)
if store and exit_code != 0:
logger.warning(
f'Iperf check failed for "{device}", {json.loads(res)["error"]}'
)
self.store_result_fail()
device_connection.disconnect()
return
Expand All @@ -51,6 +53,9 @@ def check(self, store=True):
command, raise_unexpected_exit=False
)
if store and exit_code != 0:
logger.warning(
f'Iperf check failed for "{device}", {json.loads(res)["error"]}'
)
self.store_result_fail()
device_connection.disconnect()
return
Expand Down
2 changes: 1 addition & 1 deletion openwisp_monitoring/monitoring/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ def _get_access_tech():
'summary_labels': [
_('Received bytes'),
_('Sent bytes'),
_('Total upload traffic'),
_('Total bytes'),
],
'unit': _(' GB'),
'order': 290,
Expand Down

0 comments on commit 4bf1fd9

Please sign in to comment.