multiSSH3 4.76__py3-none-any.whl → 4.83__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of multiSSH3 might be problematic. Click here for more details.
- {multiSSH3-4.76.dist-info → multiSSH3-4.83.dist-info}/METADATA +72 -58
- multiSSH3-4.83.dist-info/RECORD +7 -0
- {multiSSH3-4.76.dist-info → multiSSH3-4.83.dist-info}/WHEEL +1 -1
- multiSSH3.py +510 -268
- multiSSH3-4.76.dist-info/RECORD +0 -7
- {multiSSH3-4.76.dist-info → multiSSH3-4.83.dist-info}/LICENSE +0 -0
- {multiSSH3-4.76.dist-info → multiSSH3-4.83.dist-info}/entry_points.txt +0 -0
- {multiSSH3-4.76.dist-info → multiSSH3-4.83.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: multiSSH3
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.83
|
|
4
4
|
Summary: Run commands on multiple hosts via SSH
|
|
5
5
|
Home-page: https://github.com/yufei-pan/multiSSH3
|
|
6
6
|
Author: Yufei Pan
|
|
@@ -19,6 +19,45 @@ A script that is able to issue commands to multiple hosts while monitoring their
|
|
|
19
19
|
Can be used in bash scripts for automation actions.
|
|
20
20
|
Also able to be imported and / or use with Flexec SSH Backend to perform cluster automation actions.
|
|
21
21
|
|
|
22
|
+
Install via
|
|
23
|
+
```
|
|
24
|
+
pip install multiSSH3
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
multiSSH3 will be available as
|
|
28
|
+
```
|
|
29
|
+
mssh
|
|
30
|
+
mssh3
|
|
31
|
+
multissh
|
|
32
|
+
multissh3
|
|
33
|
+
multiSSH3
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
multissh will read a config file located at ```/etc/multiSSH3.config.json```
|
|
37
|
+
|
|
38
|
+
To store / generate a config file with the current command line options, you can use
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
mssh --generate_default_config_file
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
You can modify the json file directly after generation and multissh will read from it for loading defaults.
|
|
45
|
+
|
|
46
|
+
Note:
|
|
47
|
+
|
|
48
|
+
If you want to store password, it will be a plain text password in this config file. This will be better to supply it everytime as a CLI argument but you should really consider setting up priv-pub key setup.
|
|
49
|
+
|
|
50
|
+
This option can also be used to store cli options into the config files. For example.
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
mssh --ipmi_interface_ip_prefix 192 --generate_default_config_file
|
|
54
|
+
```
|
|
55
|
+
will store
|
|
56
|
+
```
|
|
57
|
+
"DEFAULT_IPMI_INTERFACE_IP_PREFIX": "192"
|
|
58
|
+
```
|
|
59
|
+
into the json file.
|
|
60
|
+
|
|
22
61
|
By defualt reads bash env variables for hostname aliases. Also able to read
|
|
23
62
|
```
|
|
24
63
|
DEFAULT_ENV_FILE = '/etc/profile.d/hosts.sh'
|
|
@@ -28,20 +67,20 @@ as hostname aliases.
|
|
|
28
67
|
For example:
|
|
29
68
|
```
|
|
30
69
|
export all='192.168.1-2.1-64'
|
|
31
|
-
|
|
70
|
+
mssh all 'echo hi'
|
|
32
71
|
```
|
|
33
72
|
|
|
34
73
|
It is also able to recognize ip blocks / number blocks / hex blocks / character blocks directly.
|
|
35
74
|
|
|
36
75
|
For example:
|
|
37
76
|
```
|
|
38
|
-
|
|
39
|
-
|
|
77
|
+
mssh testrig[1-10] lsblk
|
|
78
|
+
mssh ww[a-c],10.100.0.* 'cat /etc/fstab' 'sed -i "/lustre/d' /etc/fstab' 'cat /etc/fstab'
|
|
40
79
|
```
|
|
41
80
|
|
|
42
81
|
It also supports interactive inputs. ( and able to async boardcast to all supplied hosts )
|
|
43
82
|
```
|
|
44
|
-
|
|
83
|
+
mssh www bash
|
|
45
84
|
```
|
|
46
85
|
|
|
47
86
|
By default, it will try to fit everything inside your window.
|
|
@@ -52,7 +91,7 @@ DEFAULT_CURSES_MINIMUM_LINE_LEN = 1
|
|
|
52
91
|
While leaving minimum 40 characters / 1 line for each host display by default. You can modify this by using -ww and -wh.
|
|
53
92
|
|
|
54
93
|
|
|
55
|
-
Use ```
|
|
94
|
+
Use ```mssh --help``` for more info.
|
|
56
95
|
|
|
57
96
|
```
|
|
58
97
|
usage: mssh [-h] [-u USERNAME] [-ea EXTRAARGS] [-p PASSWORD] [-11] [-f FILE] [--file_sync] [--scp] [-t TIMEOUT] [-r REPEAT] [-i INTERVAL] [--ipmi]
|
|
@@ -121,23 +160,24 @@ Following document is generated courtesy of Mr.ChatGPT-o1 Preview:
|
|
|
121
160
|
|
|
122
161
|
## Table of Contents
|
|
123
162
|
|
|
124
|
-
- [
|
|
125
|
-
- [
|
|
126
|
-
- [
|
|
127
|
-
- [
|
|
128
|
-
|
|
129
|
-
- [
|
|
130
|
-
- [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
- [
|
|
139
|
-
- [
|
|
140
|
-
- [
|
|
163
|
+
- [multiSSH3](#multissh3)
|
|
164
|
+
- [multissh](#multissh)
|
|
165
|
+
- [Table of Contents](#table-of-contents)
|
|
166
|
+
- [Features](#features)
|
|
167
|
+
- [Basic Syntax](#basic-syntax)
|
|
168
|
+
- [Command-Line Options](#command-line-options)
|
|
169
|
+
- [Examples](#examples)
|
|
170
|
+
- [Running a Command on Multiple Hosts](#running-a-command-on-multiple-hosts)
|
|
171
|
+
- [Copying Files to Multiple Hosts](#copying-files-to-multiple-hosts)
|
|
172
|
+
- [Using Hostname Ranges](#using-hostname-ranges)
|
|
173
|
+
- [Using IPMI](#using-ipmi)
|
|
174
|
+
- [Using Password Authentication](#using-password-authentication)
|
|
175
|
+
- [Skipping Unreachable Hosts](#skipping-unreachable-hosts)
|
|
176
|
+
- [JSON Output](#json-output)
|
|
177
|
+
- [Quiet Mode](#quiet-mode)
|
|
178
|
+
- [Environment Variables](#environment-variables)
|
|
179
|
+
- [Notes](#notes)
|
|
180
|
+
- [License](#license)
|
|
141
181
|
|
|
142
182
|
## Features
|
|
143
183
|
|
|
@@ -152,36 +192,10 @@ Following document is generated courtesy of Mr.ChatGPT-o1 Preview:
|
|
|
152
192
|
- **Interactive Mode**: Run interactive commands with curses-based UI for monitoring.
|
|
153
193
|
- **Quiet Mode**: Suppress output for cleaner automation scripts.
|
|
154
194
|
|
|
155
|
-
## Installation
|
|
156
|
-
|
|
157
|
-
1. **Clone the Repository**
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
git clone https://github.com/yourusername/multissh.git
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
2. **Navigate to the Directory**
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
cd multissh
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
3. **Make the Script Executable**
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
chmod +x multissh.py
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
4. **Install Dependencies**
|
|
176
|
-
|
|
177
|
-
Ensure you have Python 3 and the required modules installed. You may need to install `curses` and `ipaddress` modules if they are not already available.
|
|
178
|
-
|
|
179
|
-
## Usage
|
|
180
|
-
|
|
181
195
|
### Basic Syntax
|
|
182
196
|
|
|
183
197
|
```bash
|
|
184
|
-
|
|
198
|
+
mssh [options] <hosts> <commands>
|
|
185
199
|
```
|
|
186
200
|
|
|
187
201
|
- `<hosts>`: Comma-separated list of target hosts. Supports ranges and wildcards.
|
|
@@ -225,7 +239,7 @@ Following document is generated courtesy of Mr.ChatGPT-o1 Preview:
|
|
|
225
239
|
### Running a Command on Multiple Hosts
|
|
226
240
|
|
|
227
241
|
```bash
|
|
228
|
-
|
|
242
|
+
mssh "host1,host2,host3" "uptime"
|
|
229
243
|
```
|
|
230
244
|
|
|
231
245
|
This command runs `uptime` on `host1`, `host2`, and `host3`.
|
|
@@ -233,7 +247,7 @@ This command runs `uptime` on `host1`, `host2`, and `host3`.
|
|
|
233
247
|
### Copying Files to Multiple Hosts
|
|
234
248
|
|
|
235
249
|
```bash
|
|
236
|
-
|
|
250
|
+
mssh -f "/path/to/local/file.txt" "host1,host2,host3" "/remote/path/"
|
|
237
251
|
```
|
|
238
252
|
|
|
239
253
|
This command copies `file.txt` to `/remote/path/` on the specified hosts.
|
|
@@ -241,7 +255,7 @@ This command copies `file.txt` to `/remote/path/` on the specified hosts.
|
|
|
241
255
|
### Using Hostname Ranges
|
|
242
256
|
|
|
243
257
|
```bash
|
|
244
|
-
|
|
258
|
+
mssh "host[01-05]" "hostname"
|
|
245
259
|
```
|
|
246
260
|
|
|
247
261
|
This expands to `host01`, `host02`, `host03`, `host04`, `host05` and runs `hostname` on each.
|
|
@@ -249,7 +263,7 @@ This expands to `host01`, `host02`, `host03`, `host04`, `host05` and runs `hostn
|
|
|
249
263
|
### Using IPMI
|
|
250
264
|
|
|
251
265
|
```bash
|
|
252
|
-
|
|
266
|
+
mssh --ipmi "192.168.1.[100-105]" "chassis power status"
|
|
253
267
|
```
|
|
254
268
|
|
|
255
269
|
Runs `ipmitool chassis power status` on the specified IPMI interfaces.
|
|
@@ -257,7 +271,7 @@ Runs `ipmitool chassis power status` on the specified IPMI interfaces.
|
|
|
257
271
|
### Using Password Authentication
|
|
258
272
|
|
|
259
273
|
```bash
|
|
260
|
-
|
|
274
|
+
mssh -p "yourpassword" "host1,host2" "whoami"
|
|
261
275
|
```
|
|
262
276
|
|
|
263
277
|
Uses `sshpass` to provide the password for SSH authentication.
|
|
@@ -265,7 +279,7 @@ Uses `sshpass` to provide the password for SSH authentication.
|
|
|
265
279
|
### Skipping Unreachable Hosts
|
|
266
280
|
|
|
267
281
|
```bash
|
|
268
|
-
|
|
282
|
+
mssh -su "host1,host2,host3" "date"
|
|
269
283
|
```
|
|
270
284
|
|
|
271
285
|
Skips hosts that are unreachable during execution.
|
|
@@ -273,7 +287,7 @@ Skips hosts that are unreachable during execution.
|
|
|
273
287
|
### JSON Output
|
|
274
288
|
|
|
275
289
|
```bash
|
|
276
|
-
|
|
290
|
+
mssh -j "host1,host2" "uname -a"
|
|
277
291
|
```
|
|
278
292
|
|
|
279
293
|
Outputs the results in JSON format, suitable for parsing.
|
|
@@ -281,7 +295,7 @@ Outputs the results in JSON format, suitable for parsing.
|
|
|
281
295
|
### Quiet Mode
|
|
282
296
|
|
|
283
297
|
```bash
|
|
284
|
-
|
|
298
|
+
mssh -q "host1,host2" "ls /nonexistent"
|
|
285
299
|
```
|
|
286
300
|
|
|
287
301
|
Suppresses all output, useful for scripts where you only care about exit codes.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
multiSSH3.py,sha256=1Un4-afx2wCyXWKgy1-Y55fpth0_L8zdb-qa_Cm3U-s,85689
|
|
2
|
+
multiSSH3-4.83.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
3
|
+
multiSSH3-4.83.dist-info/METADATA,sha256=A3OVJ44Q0Oi8_1na-AredxReylobi6DX2m87o1z7-4s,15887
|
|
4
|
+
multiSSH3-4.83.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
5
|
+
multiSSH3-4.83.dist-info/entry_points.txt,sha256=xi2rWWNfmHx6gS8Mmx0rZL2KZz6XWBYP3DWBpWAnnZ0,143
|
|
6
|
+
multiSSH3-4.83.dist-info/top_level.txt,sha256=tUwttxlnpLkZorSsroIprNo41lYSxjd2ASuL8-EJIJw,10
|
|
7
|
+
multiSSH3-4.83.dist-info/RECORD,,
|