PSSH provides parallel versions of OpenSSH and related tools. Included are pssh, pscp, prsync, pnuke, and pslurp. The project includes psshlib which can be used within custom applications. The source code is written in Python and can be cloned from:

git clone git://aml.cs.byu.edu/pssh.git

PSSH is supported on Python 2.4 and greater (including Python 3.1 and greater). It was originally written and maintained by Brent N. Chun. Due to his busy schedule, Brent handed over maintenance to Andrew McNabb in October 2009.

安装pssh 2.1.1
从 http://code.google.com/p/parallel-ssh/下载
http://parallel-ssh.googlecode.com/files/pssh-2.3.1.tar.gz
[root@monitor opt]#tar xzvf pssh-2.3.1.tar.gz
[root@monitor opt]# cd pssh-2.3.1
[root@monitor pssh-2.3.1]# ls
AUTHORS bin build ChangeLog COPYING INSTALL man PKG-INFO psshlib setup.py test
[root@monitor pssh-2.3.1]#python setup.py install

执行命令
Example: pssh -h 3.txt -l root -o /tmp/foo uptime
拷贝文件
Example: pscp -h 3.txt -l root foo.txt /home/root/foo.txt

[root@monitor tool]# pssh -h 3.txt -l root -P uptime
10.0.3.2: 10:41:26 up 20 days, 1:09, 0 users, load average: 0.33, 0.35, 0.35
10.0.3.3: 10:41:26 up 64 days, 1:25, 0 users, load average: 0.39, 0.37, 0.38
10.0.3.5: 10:41:26 up 27 days, 2:23, 0 users, load average: 0.25, 0.33, 0.33
10.0.3.4: 10:41:26 up 274 days, 19 min, 0 users, load average: 0.22, 0.34, 0.38
10.0.3.7: 10:41:26 up 52 days, 1:24, 0 users, load average: 0.40, 0.50, 0.49
10.0.3.8: 10:41:26 up 41 days, 1:38, 0 users, load average: 0.14, 0.27, 0.31
10.0.3.9: 10:41:26 up 23 days, 1:06, 0 users, load average: 0.34, 0.37, 0.39
10.0.3.6: 10:41:26 up 274 days, 19 min, 0 users, load average: 0.56, 0.46, 0.41
[1] 10:41:26 [SUCCESS] 10.0.3.2
[2] 10:41:26 [SUCCESS] 10.0.3.3
[3] 10:41:26 [SUCCESS] 10.0.3.5
[4] 10:41:26 [SUCCESS] 10.0.3.4
[5] 10:41:26 [SUCCESS] 10.0.3.7
[6] 10:41:26 [SUCCESS] 10.0.3.8
[7] 10:41:26 [SUCCESS] 10.0.3.9
[8] 10:41:26 [SUCCESS] 10.0.3.6
拷贝文件
[root@monitor tool]# pscp -h 3.txt hwconfig /usr/local/hwconfig
[1] 10:42:33 [SUCCESS] 10.0.3.2
[2] 10:42:33 [SUCCESS] 10.0.3.5
[3] 10:42:33 [SUCCESS] 10.0.3.3
[4] 10:42:33 [SUCCESS] 10.0.3.4
[5] 10:42:33 [SUCCESS] 10.0.3.8
[6] 10:42:33 [SUCCESS] 10.0.3.7
[7] 10:42:33 [SUCCESS] 10.0.3.6
[8] 10:42:33 [SUCCESS] 10.0.3.9
检查一下
[root@monitor tool]# pssh -h 3.txt -l root -P “ls /usr/local/hwconfig”
10.0.3.3: /usr/local/hwconfig
10.0.3.2: /usr/local/hwconfig
10.0.3.5: /usr/local/hwconfig
10.0.3.4: /usr/local/hwconfig
10.0.3.7: /usr/local/hwconfig
10.0.3.8: /usr/local/hwconfig
10.0.3.6: /usr/local/hwconfig
10.0.3.9: /usr/local/hwconfig
[1] 10:42:54 [SUCCESS] 10.0.3.3
[2] 10:42:54 [SUCCESS] 10.0.3.2
[3] 10:42:54 [SUCCESS] 10.0.3.5
[4] 10:42:54 [SUCCESS] 10.0.3.4
[5] 10:42:54 [SUCCESS] 10.0.3.7
[6] 10:42:54 [SUCCESS] 10.0.3.6
[7] 10:42:54 [SUCCESS] 10.0.3.8
[8] 10:42:54 [SUCCESS] 10.0.3.9
[root@monitor tool]#

One thought on “PSSH”

  1. Actually like your websites particulars! Undoubtedly a wonderful offer of information that is exailordrnarity helpful. Stick with it to hold publishing and that i’m gonna proceed reading by means of! Cheers.

发表评论

电子邮件地址不会被公开。 必填项已用*标注