标签:style blog http color 使用 os io 文件
[root@localhost ~]# wget https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz --2014-05-22 20:56:16-- https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz Resolving pypi.python.org... failed: Name or service not known. wget: unable to resolve host address “pypi.python.org” [root@localhost ~]# wget https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz --2014-05-22 20:56:27-- https://pypi.python.org/packages/source/p/pssh/pssh-2.3.1.tar.gz Resolving pypi.python.org... 103.245.222.175 Connecting to pypi.python.org|103.245.222.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 23427 (23K) [application/octet-stream] Saving to: “pssh-2.3.1.tar.gz” 100%[========================================================================================================================================================================>] 23,427 124K/s in 0.2s 2014-05-22 20:56:28 (124 KB/s) - “pssh-2.3.1.tar.gz” saved [23427/23427] [root@localhost ~]# tar zxf pssh-2.3.1.tar.gz [root@localhost ~]# cd pssh-2.3.1 [root@localhost pssh-2.3.1]# python setup.py install 安装完毕后会有如下提示 copying build/scripts-2.6/pslurp -> /usr/bin copying build/scripts-2.6/pssh -> /usr/bin copying build/scripts-2.6/pnuke -> /usr/bin copying build/scripts-2.6/pscp -> /usr/bin copying build/scripts-2.6/prsync -> /usr/bin copying build/scripts-2.6/pssh-askpass -> /usr/bin
[root@localhost ~]# pssh -H 192.168.1.100 -i ls #单台机器 -H 参数 [1] 03:12:05 [SUCCESS] 192.168.1.100 anaconda-ks.cfg hellotest install.log install.log.syslog nginx ocaml-4.01.0.tar.gz password rsync-3.0.4 rsync-3.0.4.tar.gz rsync_install.sh test.sh zabbix-2.0.8 zabbix-2.0.8.tar.gz [root@localhost ~]# cat ip.txt #多台机器的话可以把IP写进一个文件里面 用-h参数指定文件 192.168.1.91 192.168.1.92 192.168.1.100 192.168.1.101 192.168.1.102 192.168.1.130 192.168.1.131 192.168.1.132 [root@localhost ~]# pssh -h ip.txt -i date #-i表示执行完毕后显示标准输出和标准错误 [1] 03:15:05 [SUCCESS] 192.168.1.92 Sun Jul 27 03:43:53 EDT 2014 [2] 03:15:05 [SUCCESS] 192.168.1.101 Sun Aug 3 23:12:03 EDT 2014 [3] 03:15:05 [SUCCESS] 192.168.1.100 Sun Aug 3 23:12:03 EDT 2014 [4] 03:15:05 [SUCCESS] 192.168.1.130 Sun Aug 3 23:17:45 EDT 2014 [5] 03:15:05 [SUCCESS] 192.168.1.131 Sun Aug 3 23:17:45 EDT 2014 [6] 03:15:05 [SUCCESS] 192.168.1.132 Sun Aug 3 23:17:45 EDT 2014 [7] 03:15:05 [SUCCESS] 192.168.1.91 Thu May 22 21:42:49 EDT 2014 [8] 03:15:10 [SUCCESS] 192.168.1.102 Sun Aug 3 23:11:58 EDT 2014 [root@localhost ~]#
标签:style blog http color 使用 os io 文件
原文地址:http://www.cnblogs.com/pping/p/3891365.html