Been at this a few days now and haven't been able to resolve, im sure its something im doing stupidly!
When I use the following command for a Mikrotik Router:
from __future__ import print_function
from pssh.pssh_client import ParallelSSHClient
hosts = ['192.168.101.1']
client = ParallelSSHClient(hosts,user='admin',password='123456')
output=client.run_command('/ip service enable 0',use_shell=False)
for line in output['192.168.101.1'].stdout:
print(line)
However when i do this its sending inverted commas around the command and the Mikrotik is throwing back an error(expected command name (line 1 column 1)) It is expecting this command without the inverted commas.
I also had to set the use_shell=False
and ONLY then im getting output from the Mikrotik that the command didn't run (expected command name (line 1 column 1). If i don't use this i get no error back from Mikrotik but the command still wasn't running.
When i use the other pssh (the one NOT installed using pip) on the command line the command works fine and doesn't send the inverted commas and it runs successfully
Any help would be greatly appreciated