32 lines
780 B
Python
32 lines
780 B
Python
import paramiko
|
|
import time
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect('140.44.44.121', username='root', password='Katzir476!', timeout=10)
|
|
|
|
chan = c.invoke_shell()
|
|
time.sleep(2)
|
|
if chan.recv_ready():
|
|
chan.recv(4096)
|
|
|
|
commands = [
|
|
"racadm get bios.SysProfileSettings.SysProfile",
|
|
"racadm get bios.ProcSettings.ProcVirtualization",
|
|
"racadm get bios.IntegratedDevices.SriovGlobalEnable",
|
|
"racadm raid get controllers",
|
|
"racadm raid get pdisks"
|
|
]
|
|
|
|
for cmd in commands:
|
|
chan.send(cmd + "\r\n")
|
|
time.sleep(2)
|
|
resp = ""
|
|
while chan.recv_ready():
|
|
resp += chan.recv(4096).decode('utf-8', errors='ignore')
|
|
time.sleep(0.5)
|
|
print(f"=== {cmd} ===")
|
|
print(resp.strip())
|
|
|
|
c.close()
|