≡ Menu

unix servers

Choosing UNIX / Linux Operating System Vendor / Software

UNIX or UNIX like operating system offers many flavors. Most Microsoft users are stuck with Windows NT / 2003 only. However, UNIX users can select a variety of UNIX like oses:
+ Linux ( Red Hat / Debian / Suse and other distros)
+ Solaris / OpenSolaris
+ BSD (FreeBSD / OpenBSD / NetBSD) etc

Few years back I used work at largest ISP in India and our team used to mange an average 8 operating systems to support our enterprise grade customers. It was headache for me as I had to document, patch and monitor each operating system. These days I recommend selecting one operating system, which may result into saving time and money. But, how do you select perfect UNIX operating system for your business? You should always consider following factors while selecting UNIX like oses:

Ease of use - Must be easy to use.

Reliability & Stability - OS must be stable to run your business and should work under heavy loads.

Budget - No one has unlimited budget or luxury to select fancy stuff. Evaluate pricing based upon your own IT budget.

Hardware / driver support - Does UNIX hardware vendor offer good support?

Application support - Does it run Oracle or ERP software? Make sure all software compatible with os.

Vendor support - Does UNIX vendor offer good support? Does that includes phone support or email support or onsite support?

Security features - Look for security features and past security track record

Addon features - Look for bundled features such as backup utility or special software. Can you modify kernel? Can filesystem hold millions of tiny files and so on.

Expertise - How much experience and expertise you have on staff to manage OS.

Scalability - Will OS scale with your business? How does OS scale when the business grows? Watch out for clustering and HA support.

OS market share - Find out if OS dominates market. A massive user base means good support and lots of skilled workers.

Community support - The best support can come from newsgroup, forums or mailing list.

Patch management - Are patches available immediately? Find out more about security disclosure policy.

Staff training and certification support.

If in doubt, ask other people or admins - Talk to your users and find their requirements. Ask to other admins or people about the requirements rather than vendor. People using UNIX oses for a long time have practical knowledge of many things and they may able to provide guideline.

Howto Use SSH To Run Command On A Remote Machine

This article examined a simple, but powerful, method to run commands on a remote machine using combination of ssh and a shell script:

Use Secure Shell (SSH) to run commands on remote UNIX systems and, with some simple scripts, put together a system that enables you to manage many systems simultaneously from one machine without having to log in directly to the machines themselves. Also examine the basics of a distributed management system and some scripts and solutions using the technique.

I have already covered how to execute commands on multiple Linux or UNIX servers via a shell script. The disadvantage of shell script is commands do not run in parallel on all servers. However, several tools exist to automate this procedure in parallel. With the help of tool called tentakel (highly recommended) , you run distributed command execution. Also, you can execute commands on multiple Linux or UNIX servers using special tools such as multixterm from expect project.

=> Distributed administration using SSH

Execute commands on multiple hosts using expect tool

This is Part III in a series on Execute Commands on Multiple Linux or UNIX Servers Simultaneously. The full series is Part I, Part II, and Part III.

In third and final part of this series I will cover expect tool. Expect is a program that talks to other interactive programs according to a script. Expect is useful for running any program which requires interaction between the program and the user. For example

Install expect

Expect comes with special pre installed script called multixterm expect. If you are using Debian Linux then use apt-get as follows :

# apt-get install expect
# apt-get install expectk

If you are using Red hat Linux then use up2date command as follows:

# up2date -i expect

Fedora core (RHEL 5) / CentOS Linux user can use yum:

# yum install expect expectk

You can use ports to install expect under FreeBSD or use following command:

# pkg_add -v -r expect

Please note you can download expect from offical web site.

General syntax of multixterm:

multixterm -xc "command arg1 arg2" server1 server2...
Multixterm creates multiple xterms that can be driven together or separately so that you can execute or run on multiple hosts/servers simultaneously. The following command line starts up two xterms using ssh to the hosts and

$ multixterm -xc "ssh root@%n"


  • -xc : The optional -xc argument indicates a command to be run in each named xterm (see -xn). With no -xc argument, the command is the current shell. This means you type command once and it get executed on both ssh hosts/servers.
  • ssh root@%n : ssh is a command to connect remote server with root user. This name will also be substituted for any %n in the command argument.

Debian Linux stores multixterm at /usr/share/doc/expect directory. You need to type commands in multixterm window itself (stdin window). Click on stdin window and type uptime or w command:
For example when I typed the uptime and w command it looked like as follows:

See also:

Tentakel to execute commands on multiple Linux or UNIX Servers

This is Part II in a series on Execute Commands on Multiple Linux or UNIX Servers Simultaneously. The full series is Part I, Part II, and Part III. Many times, you want to execute a command not only on one server, but also on several servers. For example, find out

  • Version of kernel
  • Version of Apache web server
  • Update static html or images files on all web servers via rsync
  • Find out user information, server information, memory usage etc
  • Security/patch checking


I have already covered how to execute commands on multiple Linux or UNIX servers via shell script. The disadvantage of script is commands do not run in parallel on all servers. However, several tools exist to automate this procedure in parallel. With the help of tool called tentakel, you run distributed command execution. It is a program for executing the same command on many hosts in parallel using ssh (it supports other methods too). Main advantage is you can create several sets of servers according requirements. For example webserver group, mail server group, home servers group etc. The command is executed in parallel on all servers in this group (time saving). By default, every result is printed to stdout (screen). The output format can be defined for each group.

How it works?

Consider the following sample setup:

admin workstation   Group                  Hosts
|----------------> www-servers        host1, host2,host3
|----------------> homeservers,

You need to install tentakel on admin workstation ( We have two group servers, first is group of web server with three host and another is homeservers with two hosts.

The requirements on the remote hosts (groups) need a running sshd server on the remote side. You need to setup ssh-key based login between admin workstation and all group servers/hosts to take full advantage of this tentakel distributed command execution method.

System requirement

Tentakel requires a working Python installation. It is known to work with Python 2.3. Python 2.2 and Python 2.1 are not supported. If you are using old version of python then please upgrade it.


Let us see howto install and configure tentakel.

Step # 1 : Download tentakel

Visit sourceforge home page to download tentakel or download RPM files from tentakel home page.

Step # 2: Install tentakel

Untar source code, enter:

# tar -zxvf tentakel-2.2.tgz

You should be root user for the install step. To install it type

# make
# make install

Step # 3 Configure groups

For demonstration purpose we will use following setup:

   admin pc                    Group           hosts
Running Debian Linux       homeservers
User: jadmin

Copy sample tentakel configuration file tentakel.conf.example to /etc directory

# cp tentakel.conf.example /etc/ tentakel.conf

Modify /etc/tentakel.conf according to above setup, at the end your file should look like as follows:

# first section: global parameters
set ssh_path="/usr/bin/ssh"
set method="ssh"  # ssh method
set user="jadmin"   # ssh username for remote servers
#set format="%d %o\n" # output format see man page
#set maxparallel="3"  # run at most 3 commands in parallel
# our home servers with two hosts
group homeservers ()
+ +
# localhost
group local ()

Save the file and exit to shell prompt. Where,
group homeservers () : Group name
+ + : Host inclusion. name is included and can be an ip address or a hostname.

Step # 4 Configure SSH password less login

Configure ssh-key based login to avoid password prompt between admin workstation and group servers for jadmin user.

Step # 5 Test tentakel

Login as jadmin and type the following command:

$ tentakel -g homeservers

interactive mode

-g groupname: Select the group groupname The group must be defined in the configuration file (here it is homeservers). If not specified tentakel implicitly assumes the default group.

At tentakel(homeservers)> prompt type command uname and uptime command as follows:

exec "uname -mrs"
exec "uptime"

Few more examples
Find who is logged on all homeservers and what they are doing (type at shell prompt)

$ tentakel -g homeservers "w"

Executes the uptime command on all hosts defined in group homeservers:

$ tentakel -g homeservers uptime

As you can see, tentakel is very powerful and easy to use tool. It also supports the concept of plugins. A plugin is a single Python module and must appear in the $HOME/.tentakel/plugins/ directory. Main advantage of plugin is customization according to your need. For example, entire web server or mysql server farm can be controlled according our requirements.
However, tentakel is not the only utility for this kind of work. There are programs that do similar things or have to do with tentakel in some way. The complete list can be found online here. tentakel should work on almost all variant of UNIX/BSD or Linux distributions.

Time is a precious commodity, especially if you're a system administrator. No other job pulls people in so many directions at once. Users interrupt you constantly with requests, preventing you from getting anything done and putting lots of pressure on you. What do you do? The answer is time management. Read our book review of Time Management for System Administrators. Continue reading Execute commands on multiple hosts using expect tool Part III of this series.


  • Read tentakel man page for tentakel configuration options
  • tentakel home page

Update: Damon confirmed that it works on Windows too with little modification.

Execute Commands on Multiple Linux or UNIX Servers

This is Part I in a series - 'Execute Commands on Multiple Linux or UNIX Servers Simultaneously'. The full series is Part I, Part II, and Part III. Some time it is necessary to execute commands on Multiple Linux or UNIX Servers, for example you would like to find out who is logged on and what they are doing on three Linux or UNIX boxes or better find out system utilization, disk space and much more. With the help of ssh you can easily setup such nice system.

Our Sample Setup

Admin Linux workstation -> Server # 1 with ssh
adm.my.com              -> server1.my.com

SSH client is a program for logging into a remote machine and for executing commands on a remote machine. If command is specified, command is executed on the remote host instead of a login shell.

$ ssh  user@server1.my.com  w

Above command will gather up all logged in users information. However if you put this command in script to gather information from three server as follows it will prompt for a password:

ssh user@server1.my.com w
ssh user@server2.my.com w
ssh user@server3.my.com w

To get rid of password you can setup ssh key based login. Once ssh keys are in place you can simply create a script as follows:

# Linux/UNIX box with ssh key based login
# SSH User name
# Email 
SUBJECT="Server user login report"
# create new file
# connect each host and pull up user listing
for host in $SERVERS
echo "--------------------------------" >>$EMAILMESSAGE
echo "* HOST: $host " >>$EMAILMESSAGE
echo "--------------------------------" >>$EMAILMESSAGE
ssh $USR@$host w >> $EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE

You need to setup your hostname and email id and then execute shell script. This is very simple yet powerful method to execute commands simultaneously on multiple Linux/UNIX servers. If you are really interested to see application output then visit here, it was produced by this script (see our forum for more). This is just small script but you are only limited by your own imagination. Few more advanced tools do exist I will cover them some time later.