Using pdsh is some kind of a knife with latches on both sides. Nevertheless it is a great tool to do things really fast on a lot of systems. It is able to execute ssh commands in parallel on many systems but also produces a overblown output, fairly bad to read. To get a consolidated output, the dshbak command is quite useful. You can use it by pipeing the pdsh output into it. The following command lists the kernel versions on all hosts in the group production (as to be defined in /etc/pdsh/machines):

pdsh -g production "uname -r" | dshbak -c
----------------
<many hosts, comma separated>
----------------
2.6.32-431.1.2.el6.x86_64
----------------
<some hosts, comma separated>
----------------
2.6.32-358.23.2.el6.x86_64

Another example might be to probe all systems for installed packages and their versions.

pdsh -g production "rpm -q nodejs" | dshbak -c

<many hosts, comma separated>
----------------
Das Paket nodejs ist nicht installiert
----------------
<some hosts, comma separated>
----------------
nodejs-0.10.25-1.x86_64
----------------
<some hosts, comma separated>
----------------
nodejs-0.8.14-1.x86_64
----------------
<some hosts, comma separated>
----------------
nodejs-0.10.20-1.x86_64

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

*

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden .