This is a small project. This is the only doc available What is this ? ============== This is a solution to monitor and use devices connected to serial ports. This includes routers, switches, power bar and servers. Today, most servers, including PCs, may be completly operated using a serial console. You can configure the BIOS from there. Using serial consoles is much cheaper than KVMs, and potentially more useful. You stuff a multiport serial card in one box and there you go. Now, how do you access serial consoles ? Using a tool like minicom. Unfortunatly, this is not practical. -You may wish to log everything to disk for 10 or 20 devices -You want an easy access to those devices using meaningful names not serial device names. -You may want multi-user access to the consoles -And minicom terminal emulation has some issues. mconsole is a daemon monitoring several serial devices and producing logs. The logs are saved in /var/log/mconsole by default, using meaningfull names. vconsole connects to mconsole using a unix domain socket and allows you to operate one device. Support devices =============== mconsole support any standard serial devices. It also support Comtrol serial devices accessed through TCP/IP. Quick start =========== mconsole requires some configution to associate names (usually server name) to some devices. The configuration files (as many as needed) are stored in /etc/mconsole. Configuration files for serials devices are stored in file with the .serial extension. Configuration files for Comtrol devices are stored with the .comtrol extension. Note that you can control all your comtrol serial device using a single configuration file. You can also control all your serial devices using a single configuration as well. For ease of maintenance, you man want to split that in several files. Here are some examples Say you have two servers reachable from /dev/ttyS0 and /dev/ttyS1 /etc/mconsole/servers.serial # some comments # The baud directive applies to the following servers. # Default baud rate is 9600 baud=115200 server1 /dev/ttyS0 baud=38400 server2 /dev/ttyS1 /etc/mconsole/servers.comtrol # This is IP or Host name of the comtrol device # The port is the base port. host=192.168.1.0 port=8000 # server3 is reachable on port 8001 (8000+1) # server4 is reachable on port 8002 server3 1 server4 2 Once you start mconsole /etc/init.d/mconsole start you can connect to any server like this # vconsole server3 At this point, you just have a prompt. Normally, mconsole will send you the last 10000 characters logged on this device. But for now, there is nothing, so you are left with a screen looking like # vconsole server3 _ Where _ is the cursor. Nothing. You hit enter. Now if you have the proper baud rate, the proper serial cable (NULL modem generally), the device should react and print its prompt.You are in busyness. So you type a few command and see how it goes. Then you hit ctrl-X (Control and X pressed at the same time) and you are back to your prompt. You do # ls -l /var/log/mconsole You see a file /var/log/mconsole/server3.log. Everything is there. Now you try vconsole again # vconsole server3 bla bla This time, you are connected to the device and the screen hold the same content you had before pressing ctrl-X. Since mconsole is sending 10000 bytes, you can even scroll back. The vc script ============= vc is just a front-end to vconsole. vc without argument will list all the files in /etc/mconsole/*.serial and /etc/mconsole/*.comtrol. If the file /etc/mconsole/index exists, it will print that file instead. (If you have many servers, you may want to enter more infor in this /etc/mconsole/index file) With one or more arguments, it just execs vconsole with those arguments. Sending BREAKs ============== Sending a BREAK to a device is a way to request either a reboot or some special initialisation. Using vconsole, you can send a break by hitting control-< (control and lower key at the same time). This is the ASCII character 28. /var/log/mconsole/*.log ======================= For each monitored device, one log file is maintained. This contains only stuff sent by the device. So you can "cat" this file. If the device is a server, you may end up with escape sequences (vi session, top). So using programms like "more" on those files may produce strange output. log file rotation ================= The file /etc/logrotate.d/mconsole perform log file rotation every month. It renames the files to device.log.1 device.log.2 and so on. After performing the rename, it uses the command vconsole --reopenlog This tells mconsole to close its (now renamed) log file and open a new one. /var/log/mconsole/*.last ======================== mconsole tries to keep the last 10000 bytes so they are sent to vconsole at connection time. Because of log file rotation, you may end up with one empty log file for a device. So connecting to this device yield no output and is kind of annoying. So mconsole always maintain a file holding the last 10000 bytes for all device. This file is maintained at log rotation time (once a month), so this is not a big issue. Having fun! =========== This was not really a design goal, but it kind of happenned. What happen if two or more users connects to the same device ? Well, they all see the device and they all work on it. They can even fight: One type something, the other perform backspaces. This may even be useful. You are trying to figure out a problem on a device with a strange error message. You call a friend over the phone and he can join with you and see what you see and type. Installation/Compilation ======================== To install, you need the linuxconf-lib package available from http://www.solucorp.qc.ca/linuxconf/download.hc. You do not need linuxconf itself, only linuxconf-lib, which oddly enough is not performing any admin task at all. It is just a library. To compile, you need to install linuxconf-devel as well. To build and install, you do make make install to build an rpm make buildrpm Author and License ================== mconsole have been written by Jacques Gelinas jacques@croesus.com It is a GPL utility. See the file LICENSE Have fun!