Managing console connections

The Patch System Test lab, like many other labs, has a mixture of different machines, some with different means of connecting up the serial console to them. The older Sun boxes have 25 pin connectors, some others have 9 pin serial connectors, and newer machines have RJ45 connectors. For the most part people will use some sort of terminal server for getting the consoles on these machines. To get the console you basically need to telnet to a port on the device and ensure that it is correctly wired to the host. A map of  server:port to host can be maintained so users know how to get to the host without needing to bother about the connection it uses.

Then along come domains on 4800’s, network management ports, and system controllers etc. Now in order for users to get access to a hosts console they need to know what type of machine it is and connect appropriately.

A couple of years ago I installed conserver to replace several scripts that we had previously. Using this people can issue one command to get a console on a machine and not need to worry about the kind of machine it is. Granted if they connect to say an X4200 they will still need to know how to use it’s SC, but they don’t need to know how they are supposed to connect to it.

The conserver service runs on a regular machine. It has a configuration file that tells it how to connect to the hosts, more on that later. When the service starts it connects to all of the hosts in the configuration file. A user who starts the conserver client program is then connected to the host they require through the conserver service. The client program in our lab resides on the server, but I run it from my desktop and connect to the service host in the lab.

Aside from the benefits I’ve already mentioned there are a couple of other useful features.

You can ‘view’ a console. Multiple people can have the same console open at a time, but only one is attached in write mode. This is useful for keeping an eye on machines and also as a training aid.

Conserver also logs all serial traffic so you can see why a machine crashed for example.

That should be enough to convince you that this software is worth looking at, so lets look at the implementation.

Installing conserver is a fairly straightforward ‘./configure;make;make install’.

The tricky bits, and they aren’t that tricky, come with configuration.

Firstly you’ll need to add

           console      782/tcp    conserver    # console server

to /etc/services.

Next you’ll need to create a password file, regardless of whether or not you intend to use passwords. So our password file just lists usernames

bearass(5.9)$ head /export/PST/etc/conserver.passwd
albertw:
john:

Next comes the actual configuration script that defines where the consoles are and how to get to them.

Well start with the default settings that define the basic operation:

### set up global access
default full    { rw *; }

# Default Settings
default * {       
# The '&' character is substituted with the console name       
logfile /var/consoles/&;       
# timestamps every hour with activity and break logging       
timestamp 1hab;       
# include the 'full' default       
include full;       
# master server is localhost       
master localhost;
}

In PST we have two brands of terminal server. Some are from MRV and others are Perle CS9000’s. The both work the same way, you telnet to a specific port, but the port numbers each uses is different. What we do next in the configuration script is define how the ports on these units are numbered so that later on when we list a host we can just say that it is plugged into say port 5 of a unit, and not have to worry about what port it is.

# Basic Settings for the perle CS9000’s

# Basic Settings for the perle CS9000's
default perle {       
type host;       
baud 9600;       
parity none;       
portbase 10000;       
portinc 1;
}

# Basic Settings for MRV console boxes
default mrv {       
type host;       
baud 9600;       
parity none;       
portbase 2000;       
portinc 100;
}

So the CS9000 starts at port 10000 and increments in 1’s ¿ 10001, 10002 etc. The MRV ports are 2000, 2100, 2200 etc.

Now we specify what type of unit each of our terminal servers is:

default pst-console-03 {include mrv; host pst-console-03;}
default pst-console-04 {include perle; host pst-console-04;}

Finally we can define the hosts themselves:

console beetle.ireland.sun.com { include pst-console-03; port 3;}
console cocaine.ireland.sun.com { include pst-console-04; port 4; }

Eventhough the hosts are connected to different terminal servers we use the same syntax to list them.

There are other machines, such as X4200’s and v20z’s that have network management ports that you ssh into to get console access. In those cases its just a matter of getting the servers ssh keys on the host SP so that ssh logins without the need for passwords work. Then the host can be added to the configuration as:

console patchtest-x4200-4 { type exec;  exec /bin/ssh patchtest-x4200-4-sp -l root; }

That covers our basic usage of conserver. The documentation also mentions being able to compile in support for tcp_wrappers and openssl for more secure connections, but thats not something I’ve played with.

1 thought on “Managing console connections”

  1. ive used conserver for a couple of years and i love it.. we used to have an ugly webpage for documenting where all console switches were.. it was a pain in the ass!!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top