feat: add various infrastructure check and automation scripts
This commit is contained in:
15
scripts/check_30.py
Normal file
15
scripts/check_30.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
try:
|
||||
c.connect('140.44.4.30', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=5)
|
||||
print("Connected to 140.44.4.30 with snarf")
|
||||
stdin, stdout, _ = c.exec_command("hostname && ip a")
|
||||
print(stdout.read().decode())
|
||||
c.close()
|
||||
except Exception as e:
|
||||
print("Failed 140.44.4.30:", e)
|
||||
|
||||
Reference in New Issue
Block a user