Monitoring the Status of Multiple Linux/BSD/OSX/Unix Hosts

daz@scampi:~$ ruptime

You may run multiple Linux servers, or BSD servers, or even AIX servers, and need to monitor uptime, load averages, and users logged in from one central point.  @davetaylor on Twitter asked for the output of the ruptime command, which got me looking into the command in more detail – hence this post!

For this example, I’ll be using three Ubuntu Servers, hence the apt-get commands – for other systems, use it’s own inbuilt package management system.

Installing the “monitoring” node is simple:

apt-get install rwho

Once this is complete, it’ll install the rwhod daemon and also the ruptime command.

If you run ruptime now, you’ll get the output from only localhost:

daz@scampi:~$ ruptime
scampi        up   56+03:39,     1 user,  load 0.00, 0.00, 0.00

So, that’s one host done.  Now to install it on the remote machines.  Please note though, as rwhod works on network broadcast traffic, this will only work for hosts on your local network in the same broadcast domain.  To install a remote machine, we just need the rwhod daemon:

apt-get install rwhod

This will install just the daemon.  Now, when you run ruptime on the central host, it’ll use broadcast traffic to pull the stats from every machine, running rwhod, to the local machine.  In this example, I have three hosts:

daz@scampi:~$ ruptime
morph         up    2+13:21,     0 users,  load 0.00, 0.00, 0.00
noddy         up   38+00:02,     1 user,   load 0.01, 0.03, 0.00
scampi        up   56+03:42,     1 user,   load 0.00, 0.00, 0.00

You can do some sorting of results, but that’s pretty much it.  I guess if you wanted to see just one host, you’d be using grep or similar to just show the one line.

This is the manpage for ruptime on Ubuntu to show the options:  http://manpages.ubuntu.com/manpages/jaunty/man1/ruptime.1.html

If you notice you have 10 people logged into a host you know nothing about, then the rwho command will show you all users logged in, to any of the hosts:

daz@scampi:~$ rwho
daz      noddy:pts/2  Jul  7 13:31
daz      scampi:pts/2 Jul  7 13:12

It might be a small tool, but you may find it useful to monitor hosts quickly – especially if you just want to see vital information such as load averages and users logged in.