0

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

danny
  • 5,140
  • 1
  • 19
  • 31
James
  • 1
  • 2
  • What does 'inverted commas' mean? Can you show debug output from the client and also server if possible? – danny Nov 23 '17 at 11:41
  • I guess you mean "quotes" when you say "inverted commas"? You should edit the question if so, because nobody says "inverted commas" in English. – John Zwinck Nov 23 '17 at 12:18

0 Answers0