萬盛學電腦網

 萬盛學電腦網 >> 服務器教程 >> linux批量管理推送工具mussh和pssh介紹

linux批量管理推送工具mussh和pssh介紹

 mussh 是shell開發的一個小工具,pssh是python開發的一個用來批量管理linux主機的工具,現在我們來介紹mussh和pssh的使用方法。

   

先說下mussh,mussh 是shell開發的一個小工具,剛學習運維和shell的朋友可以拿來鍛煉下,做個工具的二次開發。


[root@devops-ruifengyun ~ ]$ apt-get install mussh

正在讀取軟件包列表... 完成
正在分析軟件包的依賴關系樹       
正在讀取狀態信息... 完成       
下列軟件包是自動安裝的並且現在不需要了:
  kde-l10n-engb kde-l10n-zhcn libffi6:i386 libglib2.0-0:i386
  libsystemd-daemon0:i386 libudev1:i386 python-async python-git python-gitdb
  python-smmap
Use 'apt-get autoremove' to remove them.
下列【新】軟件包將被安裝:
  mussh
升級了 0 個軟件包,新安裝了 1 個軟件包,要卸載 0 個軟件包,有 205 個軟件包未被升級。
需要下載 14.4 kB 的軟件包。
解壓縮後會消耗掉 71.7 kB 的額外空間。
獲取:1 http://mirrors.oschina.net/ubuntu/ saucy/universe mussh all 1.0-1 [14.4 kB]
下載 14.4 kB,耗時 0秒 (30.3 kB/s)
Selecting previously unselected package mussh.
(正在讀取數據庫 ... 系統當前共安裝有 234998 個文件和目錄。)
正在解壓縮 mussh (從 .../archives/mussh_1.0-1_all.deb) ...
正在處理用於 man-db 的觸發器...
正在設置 mussh (1.0-1) ...
[root@devops-ruifengyun ~ ]$
linux批量管理推送工具mussh和pssh介紹   三聯


mussh的幫助,會看到他的幫助相當的簡單。

 代碼如下   [root@devops-ruifengyun ~ ]$ mussh --help
Usage: mussh [OPTIONS] <-h host.. | -H hostfile> [-c cmd] [-C scriptfile]
mussh --help        for full help text
 
Send a command or list of commands to multiple hosts.
 
OPTIONS:
        --help          This text.
        -d [n]          Verbose debug.  Prints each action, all hosts
                        and commands to be executed to STDERR.  'n' can
                        be from 0 to 2.
        -v [n]          Ssh debug levels.  Can be from 0 to 3.
        -m [n]          Run concurrently on 'n' hosts at a time (asynchronous).
                        Use '0' (zero) for infinite. (default if -m)
        -q              No output unless necessary. 
        -i <identity> [identity ..]
                        Load an identity file.  May be used
                        more than once.
        -o <ssh-args>   Args to pass to ssh with -o option.
        -a              Force loading ssh-agent.
        -A              Do NOT load ssh-agent.
        -b              Print each hosts' output in a block without mingling
                        with other hosts' output.
        -B              Allow hosts' output to mingle. (default)
        -u              Unique.  Eliminate duplicate hosts. (default)
        -U              Do NOT make host list unique.
        -P              Do NOT fall back to passwords on any host.  This will
                        skip hosts where keys fail.
    -l <login>      Use 'login' when no other is specified with hostname.
    -L <login>      Force use of 'login' name on all hosts.
        -s <shell>      Path to shell on remote host. (Default: bash)
        -t <secs>       Timeout setting for each session.
                        (requires openssh 3.8 or newer)
        -V              Print version info and exit.
PROXY ARGS:
        -p [user@]<host>
                        Host to use as proxy.  (Must have mussh installed)
        -po <ssh-args>        Args to pass to ssh on proxy with -o option.
HOST ARGS:
        -h [user@]<host> [[user@]<host> ..]
                        Add a host to list of hosts.  May be
                        used more than once.
        -H <file> [file ..]
          &nb
copyright © 萬盛學電腦網 all rights reserved