diff --git a/monitor.py b/monitor.py index 83b5769..8a928a9 100644 --- a/monitor.py +++ b/monitor.py @@ -970,6 +970,7 @@ class NetworkMonitor: except Exception as e: logger.error(f'Monitor loop error: {e}', exc_info=True) time.sleep(30) + continue time.sleep(self.poll_interval) diff --git a/tests/test_diagnose.py b/tests/test_diagnose.py index 04b0395..e70425d 100644 --- a/tests/test_diagnose.py +++ b/tests/test_diagnose.py @@ -36,6 +36,12 @@ class TestBuildSshCommand: cmd = DiagnosticsRunner.build_ssh_command('10.0.0.1', 'eth0') assert 'ethtool' in cmd + def test_dmesg_uses_fixed_string_grep(self): + # grep -F prevents iface names with dots (e.g. eth0.1) being treated as + # regex wildcards; -- prevents leading - from being parsed as a flag + cmd = DiagnosticsRunner.build_ssh_command('10.0.0.1', 'eth0') + assert 'grep -F --' in cmd + # ── parse_output ─────────────────────────────────────────────────────────────