Implement patient vital signs monitoring system with Contec CMS7000PLUS integration and real-time dashboard
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import psutil
|
||||
import time
|
||||
|
||||
print("Monitoring TCP connections for traffic from 202.114.4.114 for 15 seconds...")
|
||||
monitor_ip = "202.114.4.114"
|
||||
start = time.time()
|
||||
found_any = False
|
||||
|
||||
while time.time() - start < 15:
|
||||
connections = psutil.net_connections(kind='tcp')
|
||||
for conn in connections:
|
||||
# Check if remote address matches the monitor IP
|
||||
if conn.raddr and conn.raddr.ip == monitor_ip:
|
||||
print(f"Connection detected: Local={conn.laddr.ip}:{conn.laddr.port}, Remote={conn.raddr.ip}:{conn.raddr.port}, Status={conn.status}")
|
||||
found_any = True
|
||||
time.sleep(0.5)
|
||||
|
||||
if not found_any:
|
||||
print("No TCP connections from 202.114.4.114 were detected during the 15-second window.")
|
||||
Reference in New Issue
Block a user