remote_multicommand
remote_multicommand provides execution of multiple commands in multiple servers in parallel (multiple processes)
Executing a list of commands in multiple servers in parallel
>>> from remote_multicommand import RemoteMultiCommand
>>> cmds_list = ['hostname','whoami']
>>> rm_cmd = RemoteMultiCommand('/tmp/sshkey')
Log: Changing log level to ERROR | Log level:ERROR | Date:01/11/2016 16:40:10
>>> rm_cmd.set_log_level('DEBUG')
Log: Changing log level to DEBUG | Log level:DEBUG | Date:01/11/2016 16: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: Executing 2 commands in the list of servers: | Log level:INFO | Date:01/11/2016 16:40:27
Log: Processing in the 4 servers will be done in 1 iterations. | Log level:INFO |
# Date:01/11/2016 16:40:27
Log: Processing 4 servers in this iteration. | Log level:DEBUG | Date:01/11/2016 16:40:27
Log: Servers: ['serverOne', 'serverTwo', 'serverThree', 'serverFour'] | Log level:DEBUG |
# Date:01/11/2016 16:40:27
Log: It took 2.338 seconds to execute command 'hostname' in all 4 servers. | Log level:INFO
# | Date:01/11/2016 16:40:30
Log: Processing in the 4 servers will be done in 1 iterations. | Log level:INFO |
# Date:01/11/2016 16:40:30
Log: Processing 4 servers in this iteration. | Log level:DEBUG | Date:01/11/2016 16:40:30
Log: Servers: ['serverOne', 'serverTwo', 'serverThree', 'serverFour'] | Log level:DEBUG |
# Date:01/11/2016 16:40:30
Log: It took 2.396 seconds to execute command 'whoami' in all 4 servers. | Log level:INFO |
# Date:01/11/2016 16:40:32
Log: Server serverTwo:
- All 2 commands were issued: Yes
- Number of commands issued: 2
- Number of commands bypassed: 0 | Log level:INFO | Date:01/11/2016 16:40:32
Log: Server serverOne:
- All 2 commands were issued: Yes
- Number of commands issued: 2
- Number of commands bypassed: 0 | Log level:INFO | Date:01/11/2016 16:40:32
Log: Server serverThree:
- All 2 commands were issued: Yes
- Number of commands issued: 2
- Number of commands bypassed: 0 | Log level:INFO | Date:01/11/2016 16:40:32
Log: Server serverFour:
- All 2 commands were issued: Yes
- Number of commands issued: 2
- Number of commands bypassed: 0 | Log level:INFO | Date:01/11/2016 16:40:32
Log: It took 4.735 seconds to execute the list of commands in all 4 servers. | Log level:INFO
| Date:01/11/2016 16: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')])]}
Installation
To install remote_multicommand, simply run:
$ pip install remote_multicommand
remote_multicommand is compatible with Python 2.6+
Documentation
Source Code
Feel free to fork, evaluate and contribute to this project.
License
GPLv3 licensed.
OBS
Due to bug https://github.com/paramiko/paramiko/issues/753, we must use paramiko versions under or equal 1.17.2
Metadata
Release files for remote-multicommand 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| remote_multicommand-0.1.3.tar.gz | 26.9 kB | Without provenance | Details for remote_multicommand-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| remote_multicommand-0.1.3-py2.7.egg | Legacy Egg format | - | - | Details for remote_multicommand-0.1.3-py2.7.egg |
Total release size: 32.2 kB
Release files / remote_multicommand-0.1.3.tar.gz
| Download URL | remote_multicommand-0.1.3.tar.gz |
|---|---|
| Size | 26.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea94a0590bd9b1c7205376dab93b4a53ebd64fbc31a651400d3532f54e29595e
|
|
BLAKE2b-256 checksum How to use checksums |
1bacc95c724764a3bb4831443013a5e83e7c5516214adbedf913587707c790c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / remote_multicommand-0.1.3-py2.7.egg
| Download URL | remote_multicommand-0.1.3-py2.7.egg |
|---|---|
| Size | 5.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
f5d61a801cb149f31acf0aa2967e30212467e3c4e4d36ec317ff5bdb53cf2223
|
|
BLAKE2b-256 checksum How to use checksums |
f78c5ff047bdbd3b7e57a0e1110683be3980684468e67c518135d2d5d8e21c22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for remote-multicommand 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.