Contrôler plusieurs serveur en parallèle ?
Je me posais la question de comment contrôler plusieurs serveur en parallèle et exécuter la même commande, en même temps et pas en séquentiel, via une connexion ssh ? et j’ai trouver la réponse dans l’utilisation de cluster ssh qui permet de manipulé plusieurs dizaines d’xterm en parallèle.
L’outil est née sur linux mais Cluster Ssh est porté sous darwin et utilisable sous OS X. En outre il est toujours possible de compiler cluster ssh sur OS X.
Alternative CsshX sous OS X
Une alternative existe, elle est ultra simple, elle consiste en un simple script perl nommée csshx codé par Gavin Brock.
L’installation est simple :
- Téléchargé csshX
- Dézipper le
- Changer les droits pour pourvoir l’exécuter
Hack pour snow leopard 10.6
Avec snow leopard OS X 10.6 pour devriez avoir le message d’erreur suivant en ligne de commande :
Can<span style="color: #ff0000;">'t load '</span><span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Perl<span style="color: #000000; font-weight: bold;">/</span>Extras<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">5.10</span><span style="color: #000000;">.0</span><span style="color: #000000; font-weight: bold;">/</span>darwin-thread-multi-2level<span style="color: #000000; font-weight: bold;">/</span>auto<span style="color: #000000; font-weight: bold;">/</span>MacPerl<span style="color: #000000; font-weight: bold;">/</span>MacPerl.bundle<span style="color: #ff0000;">' for module MacPerl: /System/Library/Perl/Extras/5.10.0/darwin-thread-multi-2level/auto/MacPerl/MacPerl.bundle: no appropriate 64-bit architecture (see "man perl" for running in 32-bit mode) at /System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm line 207. at /usr/local/bin/csshx line 237 Compilation failed in require at /usr/local/bin/csshx line 237. BEGIN failed--compilation aborted at /usr/local/bin/csshx line 237.</span>
La solution la plus simple est de remplacer la première ligne du script
<span style="color: #808080; font-style: italic;">#!/usr/bin/perl</span>
Par
<span style="color: #808080; font-style: italic;">#!/usr/bin/perl5.8.9</span>
Vous trouverez l’intégralité des explications dans le bug tracking de csshX

