PSSH: Parallel SSH Tools, un conjunto de herramientas útiles para administradores | Algo de Linux

domingo, 17 de febrero de 2013

PSSH: Parallel SSH Tools, un conjunto de herramientas útiles para administradores

PSSH (http://code.google.com/p/parallel-ssh/) nos proporciona una versión de herramientas ssh escritas en python que se lanzan en paralelo sobre un conjunto de máquinas:
  • pssh, para ejecutar comandos en paralelo sobre un conjunto de máquinas.
  • pscp, para copiar archivos en paralelo a un conjunto de máquinas.
  • prsync, para hacer un rsync en paralelo sobre un conjunto de máquinas.
  • pnuke, para matar procesos en paralelo en un conjunto de máquinas.
  • pslurp, para copiar archivos en paralelo desde un conjunto de hosts a una máquina local.
Veamos a continuación como instalar pssh.
Primero, descargamos el código fuente:

$ cd ~ ; wget http://parallel-ssh.googlecode.com/files/pssh-2.3.1.tar.gz  

Segundo, descomprimimos en /usr/src:

$ tar xfvz ~/pssh-2.3.1.tar.gz -C /usr/src

Tercero, nos desplazamos al directorio donde hemos descomprimido el código fuente:

$ cd /usr/src/pssh-2.3.1 

Cuarto, instalamos:

$ sudo python setup.py install

Y veremos una salida como la siguiente:

running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/psshlib
copying psshlib/__init__.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/task.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/manager.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/askpass_server.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/cli.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/askpass_client.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/version.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/color.py -> build/lib.linux-i686-2.6/psshlib
copying psshlib/psshutil.py -> build/lib.linux-i686-2.6/psshlib
running build_scripts
creating build/scripts-2.6
copying and adjusting bin/pssh -> build/scripts-2.6
copying and adjusting bin/pnuke -> build/scripts-2.6
copying and adjusting bin/prsync -> build/scripts-2.6
copying and adjusting bin/pslurp -> build/scripts-2.6
copying and adjusting bin/pscp -> build/scripts-2.6
copying and adjusting bin/pssh-askpass -> build/scripts-2.6
changing mode of build/scripts-2.6/pssh from 644 to 755
changing mode of build/scripts-2.6/pnuke from 644 to 755
changing mode of build/scripts-2.6/prsync from 644 to 755
changing mode of build/scripts-2.6/pslurp from 644 to 755
changing mode of build/scripts-2.6/pscp from 644 to 755
changing mode of build/scripts-2.6/pssh-askpass from 644 to 755
running install_lib
creating /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/__init__.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/task.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/manager.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/askpass_server.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/cli.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/askpass_client.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/version.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/color.py -> /usr/local/lib/python2.6/dist-packages/psshlib
copying build/lib.linux-i686-2.6/psshlib/psshutil.py -> /usr/local/lib/python2.6/dist-packages/psshlib
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/task.py to task.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/manager.py to manager.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/askpass_server.py to askpass_server.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/cli.py to cli.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/askpass_client.py to askpass_client.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/version.py to version.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/color.py to color.pyc
byte-compiling /usr/local/lib/python2.6/dist-packages/psshlib/psshutil.py to psshutil.pyc
running install_scripts
copying build/scripts-2.6/prsync -> /usr/local/bin
copying build/scripts-2.6/pslurp -> /usr/local/bin
copying build/scripts-2.6/pscp -> /usr/local/bin
copying build/scripts-2.6/pnuke -> /usr/local/bin
copying build/scripts-2.6/pssh-askpass -> /usr/local/bin
copying build/scripts-2.6/pssh -> /usr/local/bin
changing mode of /usr/local/bin/prsync to 755
changing mode of /usr/local/bin/pslurp to 755
changing mode of /usr/local/bin/pscp to 755
changing mode of /usr/local/bin/pnuke to 755
changing mode of /usr/local/bin/pssh-askpass to 755
changing mode of /usr/local/bin/pssh to 755
running install_data
copying man/man1/pssh.1 -> /usr/local/man/man1
copying man/man1/pscp.1 -> /usr/local/man/man1
copying man/man1/prsync.1 -> /usr/local/man/man1
copying man/man1/pslurp.1 -> /usr/local/man/man1
copying man/man1/pnuke.1 -> /usr/local/man/man1
running install_egg_info
Writing /usr/local/lib/python2.6/dist-packages/pssh-2.3.1.egg-info

Si os fijáis en la salida del comando de instalación, veréis que todas estas utilidades se instalan en /usr/local/bin/ y que los archivos de ayuda se instalan en /usr/local/man

No hay comentarios: