Fanout and Fanterm - introduction

Fanout and fanterm are two utilities that allow you to run commands on multiple machines. The difference is that fanout only runs non-interactive commands (like dd, cat, adduser, uname -a, etc.) and pipelines built of these. The output is collected into a single display that can be viewed by less or redirected to a file.

Fanterm, on the other hand, allows you to run interactive text mode commands on multiple machines at the same time. Your keystrokes are sent to a shell or application running on each of the target systems. The output from each system is shown in a seperate xterm.

See below for examples and sample output.


Fanout allows you to run non-interactive commands on remote machines simultaneously, collecting the output in an organized fashion. The syntax is:

fanout [--noping] "{space separated list of systems}" "{commands to run}"

By default, fanout pings each of the remote machines to make sure they're up before trying to ssh to them. If they're not pingable (because of a firewall), put --noping as the first parameter.

A "System" is a bit of a misnomer; it could be a fully qualified domain, an entry in /etc/hosts, an IP address, an entry in ~/.ssh/config, or any of those preceeded with user_account@ . In short, if you can type ssh something and get a command prompt, it can be used as a "system" above.

You can run as many commands as you'd like on the remote systems. These need to be separated by semicolons. You can also run pipelines of comands, such as

cat /etc/passwd | grep '^gparker:' | awk -F: '{print $3}'
to see what uid gparker has on each of the remote systems.


Sample run

#Sample run
[wstearns@sparrow fanout]$ fanout "localhost wstearns@localhost aaa.bbb.ccc" "uptime" | less
aaa.bbb.ccc unavailable
Starting localhost
Starting wstearns@localhost
Fanout executing "uptime"
Start time Fri Apr 7 00:13:07 EDT 2000 , End time Fri Apr 7 00:13:20 EDT 2000
==== On aaa.bbb.ccc ====
==== Machine unreachable by ping

==== On localhost ====
   12:13am  up 3 days, 10:44,  0 users,  load average: 0.17, 0.17, 0.22

==== As wstearns on localhost ====
   12:13am  up 3 days, 10:44,  0 users,  load average: 0.15, 0.16, 0.22

The command(s) you execute run concurrently on each remote machine. Output does not show up until all are done.


From an xterm, type:

fansetup onemachine anothermachine user@yetathirdmachine

and you'll get 3 additional xterms. Type your commands in the original terminal; each command will be sent to each machine and you'll see the output from each machine in the other xterms. This even works for interactive commands like editors.

Here's an example:

The following characters were typed in the original window (the botom one): uptime<Enter>df /tmp<Enter>And I'm typing another command now...


Here's what works:

Here are the known limitations:

Simply getting all your xterms on one display can be an issue if you're trying to control a lot of remote systems. The command line parameter "--geometry colsxlines will shrink all subsequent xterms to that size.

fansetup --geometry 80x7 onemachine anothermachine user@yetathirdmachine



For a complete list of all files, see filelist.html.

Copyright 2000-2003 William Stearns <>

Last edited: 5/11/2003

Best viewed with something that can show web pages... <grin>