slex

SSH multiplex

  • 所有者: crosbymichael/slex
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

SLEX

Build Status

slex is a simple binary that allows you to run a command on multiple hosts via SSH.
It is very similar to fabric except that it is written in Go so you don't have to
have python installed on your system and you don't have to write a script or
configuration files if you do not want to.

Building

To build slex you must have a working Go install then you can run:

go get -u github.com/crosbymichael/slex
slex -h
NAME:
   slex - SSH commands multiplexed

USAGE:
   slex [global options] command [command options] [arguments...]

VERSION:
   1

AUTHOR:
  @crosbymichael - <crosbymichael@gmail.com>

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --debug                     enable debug output for the logs
   --host value                SSH host address
   --hosts value               file containing host addresses separated by a new line
   --user value, -u value      user to execute the command as (default: "root")
   --identity value, -i value  SSH identity to use for connecting to the host
   --option value, -o value    SSH client option
   --agent, -A                 Forward authentication request to the ssh agent
   --env value, -e value       set environment variables for SSH command
   --quiet, -q                 disable output from the ssh command
   --help, -h                  show help
   --version, -v               print the version

For the list of supported SSH client option, see SSHClientOptions on config.go

Get the uptime for all servers

slex --host 192.168.1.3 --host 192.168.1.4 uptime
[192.168.1.3:22]  01:05:20 up  4:44,  0 users,  load average: 0.35, 0.39, 0.33
[192.168.1.4:22]  01:05:20 up  9:45,  0 users,  load average: 0.04, 0.07, 0.06

Run a docker container on all servers

slex --host 192.168.1.3 --host 192.168.1.4 docker run --rm busybox echo "hi slex"
[192.168.1.3:22] hi slex
[192.168.1.4:22] hi slex

Pipe scripts to all servers

echo "echo hi again", slex --host 192.168.1.3 --host 192.168.1.4
[192.168.1.3:22] hi again
[192.168.1.4:22] hi again

License - MIT

主要指標

概覽
名稱與所有者crosbymichael/slex
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-10-16 05:02:48
推送於2021-02-03 21:03:14
最后一次提交2021-02-03 16:03:06
發布數3
最新版本名稱20.9.0 (發布於 )
第一版名稱2 (發布於 )
用户参与
星數558
關注者數15
派生數48
提交數85
已啟用問題?
問題數7
打開的問題數3
拉請求數27
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?