[SunHELP] How to redirect sysLog file to a printer?

Robert Cross sunhelp at sunhelp.org
Wed Jul 25 05:23:17 CDT 2001


>Assuming lp is correctly configured...

>tail -f /var/log/syslog | lpr

>Will.

>----- Original Message -----
>From: "Bego=F1a Llorente" <bllorente at cirsa.com>
>To: <SunHELP at sunhelp.org>
>Sent: Wednesday, July 25, 2001 9:51 AM
>Subject: [SunHELP] How to redirect sysLog file to a printer?
>> Hi, can anyone help me? I want to redirect my syslog file to a printer
>> because we want to have a hard copy of applications alarms in paper at
>> the moment they are happening. I'm trying 'tail -f /var/log/syslog >
>> /dev/printer' but it does not print anything. Any idea?

Errm, that won't work as the file is never completed. "tail -20
/var/log/syslog|lpr"
probably would work, but it won't do what Bego=F1a requires.

Personally, I'd go for the straight forward solution as follows:
1.   Hang an ASCII capable printer off of the back of the system directly,
an old
dot matrix is ideal for this.
2.   Setup a print queue to go to this printer (perhaps?)
3.   Update the syslog.conf to send a copy of the desired messages to the
port that
the printer is attached to, e.g.
*.warning /dev/ttys0
4.   Stop and restart syslog to make the change active.

Sorry if some of the details are a bit sketchy, but it's been about 5 years
since I did this last.
A friend of mine was doing something similar, but ended up writing a little
script to send batches
of warnings to the printer, (it was a remote printer so it was best done
this way).

Regards

Robert Cross, Senior Systems Programmer, EDS (UK) Ltd.
DISCLAIMER: information contained herein is purely the responsibility of
the author.




* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This message is confidential.  It may also be privileged or
protected by other legal rules.  It does not constitute an
offer or acceptance of an offer, nor shall it form any part
of a legally binding contract.  If you have received this
communication in error, please let us know by reply then
destroy it.  You should not use, print, copy the message or
disclose its contents to anyone.

E-mail is subject to possible data corruption, is not
secure, and its content does not necessarily represent the
opinion of this Company.  No representation or warranty is
made as to the accuracy or completeness of the information
and no liability can be accepted for any loss arising from
its use.

This e-mail and any attachments are not guaranteed to be
free from so-called computer viruses and it is recommended
that you check for such viruses before down-loading it to
your computer equipment.  This Company has no control over
other websites to which there may be hypertext links and no
liability can be accepted in relation to those sites.

Scottish & Newcastle plc
Registered in Scotland, Registered Number 16288
Registered Office: 33, Ellersly Road, Edinburgh, EH12 6HX
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *



More information about the SunHELP mailing list