in reply to Log watcher which outputs alerts in xterm windows
Actually, my advice would be to get a copy of swatch and start with it. This is probably the most common solution to the problem of watching log files. It is an optional package on most Linux distributions. If it doesn't do everything you want, it is written in Perl, so you can just edit it. Note that it solves several problems besides the ones that you mention, like playing well with logrotate when it truncates the log files.
Out of the box, it doesn't have the ability to monitor more than one log file at once. You could run a copy of swatch for each file, each with its own output window. Or, you could hack the source of swatch to allow multiple input files. Or, try this: create a named pipe with mkfifo, run one copy of tail -f for each input file, all sending their output to the pipe, and have swatch read the pipe as its input.
Whatever you do, don't allow your monitoring process to open a new window every two minutes without closing any of the previous ones automatically. If the graveyard shift operator catches the flu and the system is left unattended for many hours, you will have hundreds of copies of both less and xterm running. Depending on the system configuration, you might risk having the system run short of memory and do Bad Things.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Log watcher which outputs alerts in xterm windows
by wishartz (Beadle) on Jun 23, 2008 at 09:08 UTC | |
by moritz (Cardinal) on Jun 23, 2008 at 09:14 UTC | |
by wishartz (Beadle) on Jun 23, 2008 at 11:43 UTC |