Git Product home page Git Product logo

multi-ssh's Introduction

multi-ssh

Execute binaries or shell scripts on multiple servers over ssh, implemented in bash only.

groups

You can define servers in different files in folder 'groups'. A group can be defined using '-g' when starting multi-ssh.sh For example customer1, customer2 or squeezy, rehl6.

Use -g all to run the command or script on all servers.

possible options

  -n|--dry-run                don't run any command, only show them
  -s|--silent                 don't show servernames
  -c|--cron                   show servername only on remote output
  -i|--stdin                  use stdin, even if CMD is not empty

usage examples

Run command uptime on all servers.

multi-ssh.sh -g all uptime

example output:

WARNING: [email protected]:2426 not reachable.
WARNING: [email protected]:2271 not reachable.
### [email protected]:2275 ###
 02:59:54 up 50 days, 12:21,  0 users,  load average: 0.00, 0.00, 0.00
WARNING: [email protected]:2276 not reachable.
### [email protected]:2288 ###
 02:59:59 up 776 days, 19:13,  0 users,  load average: 0.25, 0.07, 0.02
### [email protected]:2272 ###
 03:00:01 up 50 days, 13:43,  1 user,  load average: 1.07, 0.64, 0.51

Pipe and execute a script with /bin/bash on multiple servers.

cat myfancyscript.sh |multi-ssh.sh -g all --stdin /bin/bash

Pipe and execute a script as root adding a parameter.

cat ~/bin/check_timezone-and-datetime.sh |multi-ssh.sh -g customer1 --silent --stdin "sudo /bin/bash -s " 0.debian.pool.ntp.org

multi-scp.sh

Copy a file to multiple servers.

multi-ssh's People

Contributors

frankschubert avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.