feat: add various infrastructure check and automation scripts
This commit is contained in:
15
scripts/check_ports_all.py
Normal file
15
scripts/check_ports_all.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import paramiko
|
||||
|
||||
nodes = ['140.44.4.71', '140.44.4.72', '140.44.4.73', '140.44.4.74', '140.44.4.75']
|
||||
for ip in nodes:
|
||||
try:
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect(ip, username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=5)
|
||||
_, o, _ = c.exec_command("echo 'Katzir476!' | sudo -S ss -tulpn | grep -E ':9100|:9101|:8080'")
|
||||
out = o.read().decode().strip()
|
||||
print(f"Node {ip}: {out if out else 'All clear'}")
|
||||
c.close()
|
||||
except Exception as e:
|
||||
print(f"Node {ip} err: {e}")
|
||||
|
||||
Reference in New Issue
Block a user