Package: remote-multicommand
remote_multicommandremote_multicommandprovides execution of multiple commands in multiple servers in parallel (multiple processes)Executing a list of commands in multiple servers in parallel>>>fromremote_multicommandimportRemoteMultiCommand>>>cmds_list=['hostname','whoami']>>>rm_cmd=RemoteMultiCommand('/tmp/sshkey')Log:ChanginglogleveltoERROR|Loglevel:ERROR|Date:01/11/201616:40:10>>>rm_cmd.set_log_level('DEBUG')Log:ChanginglogleveltoDEBUG|Loglevel:DEBUG|Date:01/11/201616:40:12>>>servers_list=['serverOne','serverTwo','serverThree','serverFour']>>>rm_cmd.launch_list_of_commands(cmds_list,num_of_process,servers_list,ssh_log_level='DEBUG')Log:Executing2commandsinthelistofservers:|Loglevel:INFO|Date:01/11/201616:40:27Log:Processinginthe4serverswillbedonein1iterations.|Loglevel:INFO|# Date:01/11/2016 16:40:27Log:Processing4serversinthisiteration.|Loglevel:DEBUG|Date:01/11/201616:40:27Log:Servers:['serverOne','serverTwo','serverThree','serverFour']|Loglevel:DEBUG|# Date:01/11/2016 16:40:27Log:Ittook2.338secondstoexecutecommand'hostname'inall4servers.|Loglevel:INFO# | Date:01/11/2016 16:40:30Log:Processinginthe4serverswillbedonein1iterations.|Loglevel:INFO|# Date:01/11/2016 16:40:30Log:Processing4serversinthisiteration.|Loglevel:DEBUG|Date:01/11/201616:40:30Log:Servers:['serverOne','serverTwo','serverThree','serverFour']|Loglevel:DEBUG|# Date:01/11/2016 16:40:30Log:Ittook2.396secondstoexecutecommand'whoami'inall4servers.|Loglevel:INFO|# Date:01/11/2016 16:40:32Log:ServerserverTwo:-All2commandswereissued:Yes-Numberofcommandsissued:2-Numberofcommandsbypassed:0|Loglevel:INFO|Date:01/11/201616:40:32Log:ServerserverOne:-All2commandswereissued:Yes-Numberofcommandsissued:2-Numberofcommandsbypassed:0|Loglevel:INFO|Date:01/11/201616:40:32Log:ServerserverThree:-All2commandswereissued:Yes-Numberofcommandsissued:2-Numberofcommandsbypassed:0|Loglevel:INFO|Date:01/11/201616:40:32Log:ServerserverFour:-All2commandswereissued:Yes-Numberofcommandsissued:2-Numberofcommandsbypassed:0|Loglevel:INFO|Date:01/11/201616:40:32Log:Ittook4.735secondstoexecutethelistofcommandsinall4servers.|Loglevel:INFO|Date:01/11/201616:40:32{'serverTwo':[OrderedDict([('command','hostname'),('access',True),('result',True),('output','serverTwo\n')]),OrderedDict([('command','whoami'),('access',True),('result',True),('output','root\n')])],'serverOne':[OrderedDict([('command','hostname'),('access',True),('result',True),('output','serverOne\n')]),OrderedDict([('command','whoami'),('access',True),('result',True),('output','root\n')])],'serverThree':[OrderedDict([('command','hostname'),('access',True),('result',True),('output','serverThree\n')]),OrderedDict([('command','whoami'),('access',True),('result',True),('output','root\n')])],'serverFour':[OrderedDict([('command','hostname'),('access',True),('result',True),('output','serverFour\n')]),OrderedDict([('command','whoami'),('access',True),('result',True),('output','root\n')])]}InstallationTo install remote_multicommand, simply run:$ pip install remote_multicommandremote_multicommand is compatible with Python 2.6+Documentationhttps://remote_multicommand.readthedocs.ioSource CodeFeel free to fork, evaluate and contribute to this project.Source:https://github.com/jonDel/remote_multicommandLicenseGPLv3 licensed.OBSDue to bughttps://github.com/paramiko/paramiko/issues/753, we must use paramiko versions under or equal 1.17.2