I am successfully executing commands over SSH using the following code:
import paramiko
hosts = ["192.168.1.156"]
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
for host in hosts:
client.connect(host, username='user', password='******')
stdin, stdout, stderr = client.exec_command("df -H")
output = ''.join(stdout.readlines())
Print(output)
However as soon as I swap the "df -H" command for "smartctl -H disk1", I get no output from Python. It's probably worth mentioning that I do not get any errors either.
When I run "smartctl -H disk1" in terminal it works fine and gives the output I would expect, but it's just running it through the Paramiko command that seems to be the issue.
Any ideas?
Cheers,
George
stderr? Or that you do not get any Python errors? + Have you seen Command executed with Paramiko does not produce any output?