Skip to content

Commit

Permalink
Adding examples to docs. Updating long_description.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolobio committed Aug 11, 2016
1 parent e2442b6 commit f88b061
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 18 deletions.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -72,7 +72,7 @@ Format the command per-host:
Possible formatting variables:
uri, fqdn, subdomain, num

Quiet SSH's error output:
Quiet SSH's error output (-q is passed to the SSH command):

$ sshm -u example.com "echo {subdomain}"

Expand All @@ -83,3 +83,7 @@ Quiet SSH's error output:
Any arguments not recognized by SSHM will be passed to ssh:

$ ssh example.com "ls" -o StrictHostKeyChecking=no

Attempt to get hostnames of the entire 10.0.0.0 subnet, do not store keys found, do not ask about keys found, do not prompt for password, timeout connection after 1 second, tell ssh to not display any error output. This command will take several days, and is not secure because all keys are ignored:

$ sshm -q 10.0-255.0-255.0-255 "hostname" -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -oBatchMode=yes -oConnectTimeout=1
55 changes: 38 additions & 17 deletions sshm/_info.py
Expand Up @@ -7,36 +7,57 @@
SSH Multi v%s. SSH into multiple machines at once.
Examples:
Get a count of processes on each server:
sshm example1.com,example2.com,example3.com,mail[01-05].example.com,host[01-25].org "ps aux | wc -l"
$ sshm example1.com,example2.com,example3.com,mail[01-05].example.com,host[01-25].org "ps aux | wc -l"
Check if postfix is running on mail servers:
sshm mail[01-03].example.com "postfix status"
$ sshm 192.168.0.1-5 "postfix status"
Verify which servers are accepting SSH connections:
sshm example[1-5].com "exit"
Copy a file to several servers. (Limited by your RAM size)
cat some_file | sshm example[1-5].com "cat > some_file"
$ sshm example[1-5,8].com "exit"
Copy a file to several servers (may not work for larger files):
$ cat some_file | sshm example[1-5].com "cat > some_file"
Specify a per-host port:
sshm example1.com:123,example2.com,example4.com:78 "exit"
$ sshm example1.com:123,example2.com,example4.com:78 "exit"
Specify multiple groups of servers, the last positional argument is assumed to be the command.
$ sshm 192.168.0.1-20 example.com,mail[03-5].example.com "uptime"
Format the command per-host:
sshm example[1-3].com "echo {fqdn}"
Outputs:
sshm: example1.com(0): example1.com
sshm: example2.com(0): example2.com
sshm: example3.com(0): example3.com
$ sshm example[1-3].com "echo {fqdn}"
Outputs:
sshm: example1.com(0): example1.com
sshm: example2.com(0): example2.com
sshm: example3.com(0): example3.com
Possible formatting variables:
uri, fqdn, subdomain, num
Quiet SSH's error output (-q is passed to the SSH command):
$ sshm -u example.com "echo {subdomain}"
executes:
(ssh -q example.com echo example)
Any arguments not recognized by SSHM will be passed to ssh:
Possible formatting variables:
uri, fqdn, subdomain, num
$ ssh example.com "ls" -o StrictHostKeyChecking=no
Quiet SSH's error output:
sshm -u example.com "echo {subdomain}"
Attempt to get hostnames of the entire 10.0.0.0 subnet, do not store keys found, do not ask about keys found, do not prompt for password, timeout connection after 1 second, tell ssh to not display any error output. This command will take several days, and is not secure because all keys are ignored:
calls:
(ssh -q example.com echo example)
$ sshm -q 10.0-255.0-255.0-255 "hostname" -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -oBatchMode=yes -oConnectTimeout=1
''' % (__version__)

0 comments on commit f88b061

Please sign in to comment.