Skip to content

Commit 1d94482

Browse files
committed
[chores] Log non-zero exit code warnings
1 parent 07aa783 commit 1d94482

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

openwisp_monitoring/check/classes/iperf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def check(self, store=True):
2727
f'DeviceConnection is not properly set for "{device}", iperf check skipped!'
2828
)
2929
return
30-
device_connection.connect()
3130
# The DeviceConnection could fail if the management tunnel is down.
3231
if not device_connection.connect():
3332
logger.warning(
@@ -40,6 +39,9 @@ def check(self, store=True):
4039
command, raise_unexpected_exit=False
4140
)
4241
if store and exit_code != 0:
42+
logger.warning(
43+
f'Iperf check failed for "{device}", {json.loads(res)["error"]}'
44+
)
4345
self.store_result_fail()
4446
device_connection.disconnect()
4547
return
@@ -51,6 +53,9 @@ def check(self, store=True):
5153
command, raise_unexpected_exit=False
5254
)
5355
if store and exit_code != 0:
56+
logger.warning(
57+
f'Iperf check failed for "{device}", {json.loads(res)["error"]}'
58+
)
5459
self.store_result_fail()
5560
device_connection.disconnect()
5661
return

openwisp_monitoring/monitoring/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,11 +582,11 @@ def _get_access_tech():
582582
'total': 'lines',
583583
},
584584
'trace_order': ['total', 'received', 'sent'],
585-
'description': _('Total transfer during Iperf3 test in TCP mode.'),
585+
'description': _('Transfer during Iperf3 test in TCP mode.'),
586586
'summary_labels': [
587+
_('Total bytes'),
587588
_('Received bytes'),
588589
_('Sent bytes'),
589-
_('Total upload traffic'),
590590
],
591591
'unit': _(' GB'),
592592
'order': 290,

0 commit comments

Comments
 (0)