feat: add various infrastructure check and automation scripts
This commit is contained in:
@@ -1,24 +1,8 @@
|
||||
import socket
|
||||
|
||||
hosts = [
|
||||
('140.44.4.11', 9100, 'Aerodrome Master 01'),
|
||||
('140.44.4.41', 9100, 'Spaceport Master 01'),
|
||||
('140.44.4.71', 9100, 'Shipyard Swarm'),
|
||||
('140.44.4.81', 9100, 'Harvester Node 01'),
|
||||
('140.44.4.81', 9400, 'Harvester Node 01 DCGM'),
|
||||
('140.44.4.11', 10250, 'Aerodrome Kubelet'),
|
||||
('140.44.4.41', 10250, 'Spaceport Kubelet'),
|
||||
('140.44.4.60', 8888, 'Zabbix Web'),
|
||||
('140.44.4.64', 10051, 'Zabbix Server'),
|
||||
]
|
||||
|
||||
for ip, port, desc in hosts:
|
||||
s = socket.socket()
|
||||
s.settimeout(1.5)
|
||||
try:
|
||||
s.connect((ip, port))
|
||||
print(f"[OPEN] {ip}:{port} ({desc})")
|
||||
s.close()
|
||||
except Exception as e:
|
||||
print(f"[CLOSED/ERR] {ip}:{port} ({desc}) - {e}")
|
||||
import paramiko
|
||||
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
_, o, _ = c.exec_command("echo 'Katzir476!' | sudo -S ss -tulpn | grep -E ':9100|:9101|:8080'")
|
||||
print(o.read().decode().strip())
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user