feat: add various infrastructure check and automation scripts
This commit is contained in:
30
scripts/check_fstab_mounts.py
Normal file
30
scripts/check_fstab_mounts.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import paramiko
|
||||
|
||||
SSH_KEY = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet"
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect("140.44.4.81", username="rancher", key_filename=SSH_KEY, timeout=10)
|
||||
|
||||
def run_cmd(cmd):
|
||||
full_cmd = f"echo Katzir476! | sudo -S sh -c '{cmd}'"
|
||||
_, o, e = c.exec_command(full_cmd)
|
||||
return o.read().decode().strip(), e.read().decode().strip()
|
||||
|
||||
print("--- /etc/fstab on Node 1 ---")
|
||||
out, _ = run_cmd("cat /etc/fstab")
|
||||
print(out)
|
||||
|
||||
print("\n--- Systemd mount units on Node 1 ---")
|
||||
out, _ = run_cmd("systemctl list-unit-files | grep -i var-lib-harvester")
|
||||
print(out)
|
||||
|
||||
print("\n--- Blkid on Node 1 ---")
|
||||
out, _ = run_cmd("blkid")
|
||||
print(out)
|
||||
|
||||
print("\n--- Any harvester disk mount script or cloud-init ---")
|
||||
out, _ = run_cmd("ls -la /oem; cat /oem/99_custom.yaml 2>/dev/null || cat /oem/harvester.config 2>/dev/null")
|
||||
print(out[:1000])
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user