Improving server management with Minicom and conserverBy Paul Virijevich on September 06, 2006 (8:00:00 AM) With all of the redundancy in today's servers, its easy to think that you will never need serial port access to your shiny new server. But what do you do when you're at home and your server is at the data center, and your trusty friend SSH fails you? Go back to where remote access started -- a console server. Trust me, there will be a time when the network goes down, or maybe you'll need to get into a server's BIOS to change a setting, or boot it in single-user mode. Without physical access, or an expensive remote management card, none of this is possible. However, with a little open source software and some cheap hardware, you can set up a remote console server for multiple machines. We'll take a look at two programs that can help: Minicom, for when networking is down and to view BIOS and boot screens, and conserver, for day-to-day console access. You'll also need some hardware. First, scrape up an older machine to use as a console server. It need not be very powerful; just about anything that runs Linux will work. It probably will have two on-board serial ports. You can buy an additional four-port serial card for around $40. Six-foot null modem cables to connect servers to the console server should cost you about $3. If you throw in a modem, you will be able to get into the console server even if the local LAN is down. Get started by enabling terminal logins to the servers. Once you've connected the null modem cables from the servers to your new console server, check the servers' /etc/inittab files and make sure you have a line like this on them all (but not on the console server): To enable root logins on the servers, edit the file /etc/securetty and add the line: Now for a quick test of serial connectivity. On the console server, issue the command: To start, try Minicom, which is included with just about every distribution. Minicom is useful for viewing BIOS and startup messages. Run Minicom from the command line on the console server. By default, Minicom points to the serial line linked to /dev/modem. Change this by bringing up Minicom in setup mode with: Now, from a command line, enter: One of the main benefits of a console server is the ability to get into the BIOS and view system initialization. To view BIOS output, the server's motherboard needs to support redirecting output to a serial port. This feature is standard on just about every server motherboard. If you are using a "white box PC" for a server, your mileage may vary. Viewing the system's startup messages is a sure thing either way. For GRUB's /boot/grub/menu.lst add: At this point, you've got everything you need to log in to remote servers and change BIOS settings. However, Minicom can be cumbersome when it comes to viewing multiple consoles. It also lacks some of the useful features found in conserver. To use conserver, each server you want to monitor needs to run the conserver server. The console server that you log into to check on your servers will run the conserver client. Installing both server and client is simple, and can be accomplished with the usual On your servers, create the directory /usr/local/etc/ if it does not exist, and copy to it the files conserver.cf and conserver.passwd from the conserver.cf subdirectory of the conserver download. The password file is pretty self-explanatory. Any username followed by You also need to add the line: Let's take a look at a sample conserver configuration. Here is a sample conserver.cf: From your console server, you can now issue the command: The console client expects to connect to a server with the name of console, which means you need to add an alias for each server to /etc/hosts or in DNS or you will get an error. The directory /var/consoles/ now contains a log file for each console (shell and ssh). All console output created while attached is now logged in those files. If you leave one of these consoles running, you can capture error messages on the console that you might otherwise never see. The combination of Minicom and conserver gives system administrators a cost-effective way to manage servers. With Minicom up and running, you can change BIOS settings and drop into run-level one without traveling to the remote location. If you have conserver, you can disable a user's SSH access to a machine and force the use of conserver (with SSL encryption of course). This technique could be handy for logging those situations where no one seems to know who accidentally deleted an important file. It can also help out when you forget what you did to fix something a week after the fact. |
|