seriallogger is a simple utility to log data that comes in on a serial port. It runs as a daemon that opens a serial device and reads whatever data comes in, writing that data to a log file. It will also rotate the log into an archive directory.
This program was originally written to run on the service processor of Sun hardware which lacks a console history. It should be useful, however, for logging any kind of data that comes in through a serial port.
SourceForge project page: http://sourceforge.net/projects/seriallogger/
Please be very careful. These instructions are intended be helpful, but there is the risk of rendering the SP inoperoperable if something goes wrong. Heed the warning that is printed when you log in with the sunservice account seriously.
If you intend to run this on the SP of a Sun x4100 or similar and want to have it log the machine's console messages to /dev/shm/seriallogger.log, rotating the log in /dev/shm once it reaches 1048576 bytes, keeping only the 4 most recent archived logs, and use /var/lock/LCK..ttyS1 as its pid file (this will cause the SP to think that the serial console is already in use if you try something like "start SP/console"), you can do something like this (you should place seriallogger in /conf so that it will stay there across boots):
/conf/seriallogger -d /dev/ttyS1 -l /dev/shm/seriallogger.log -a /dev/shm -m 1048576 -n 4 -i /var/lock/LCK..ttyS1
In order to have it start up when the SP boots, you might also want to add something like the following to /conf/crontab. You should probably run it at least once first before rebooting, though, just to check that it works and gain some confidence that it won't break startup (if that happens, your SP will likely no longer be usable).
@reboot root /conf/seriallogger -d /dev/ttyS1 -l /dev/shm/seriallogger.log -a /dev/shm -m 1048576 -n 4 -i /var/lock/LCK..ttyS1
If you intend to run this on the SP of a Sun x4150, you can run seriallogger with something like this:
/conf/seriallogger -d /dev/ttyS0 -l /dev/shm/seriallogger.log -a /dev/shm -m 1048576 -n 4 -i /var/lock/LCK..ttyS0
To make it start at boot, you can add a line like the following to /conf/interfaces (this is probably not the best way to do this, but it is the only thing that we could think of). You should probably run it at least once first before rebooting, though, just to check that it works and gain some confidence that it won't break startup (if that happens, your SP will likely no longer be usable).
up /conf/seriallogger -d /dev/ttyS0 -l /dev/shm/seriallogger.log -a /dev/shm -m 1048576 -n 4 -i /var/lock/LCK..ttyS0
The latest firmware for the x4150 SP disables the sunservice account. Here is how we re-enabled it:
up /usr/local/bin/sunserviceacct enable
crosstool is an excellent tool for building cross-toolchains that can be used to cross-compile things (like seriallogger).
seriallogger 0.2 Source | seriallogger-0.2.tar.gz |
seriallogger 0.2 Binary for ppc SP | seriallogger-0.2-ppc-sunSP.tar.gz |
seriallogger 0.2 Binary for arm x4150 elom SP | seriallogger-0.2-arm-x4150elomSP.tar.gz |
seriallogger 0.1 Source | seriallogger-0.1.tar.gz |
seriallogger 0.1 Binary for ppc SP | seriallogger-0.1-ppc-sunSP.tar.gz |