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

Bageshwar X Kumar sunhelp at sunhelp.org
Wed Jul 25 05:30:58 CDT 2001


--0__=EmQUhNPJ6YjlWWXWqcSgHula3foeOAegH7Os6pZELO8kVOEUSCFV4LsL
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline

tail -f /var/adm/syslog   produces a real time file output and hence it is not
complete .. Instead try this ::

tail -10 /var/adm/syslog | lpr




|--------+------------------------------------->
|        |                                     |
|        |          Robert.Cross at scottish-newca|
|        |          stle.co.uk                 |
|        |                                     |
|        |          25/07/01 11:23             |
|        |          Please respond to sunhelp  |
|        |                                     |
|--------+------------------------------------->
  >----------------------------------------------------------------------------|
  |                                                                            |
  |       To:     sunhelp at sunhelp.org                                          |
  |       cc:     (bcc: Bageshwar X Kumar)                                     |
  |       Subject:     Re: [SunHELP] How to redirect sysLog file to a printer? |
  >----------------------------------------------------------------------------|





--0__=EmQUhNPJ6YjlWWXWqcSgHula3foeOAegH7Os6pZELO8kVOEUSCFV4LsL
Content-type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-transfer-encoding: quoted-printable





>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 print=
er
>> 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 direct=
ly,
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 t=
he
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 y=
ears
since I did this last.
A friend of mine was doing something similar, but ended up writing a li=
ttle
script to send batches
of warnings to the printer, (it was a remote printer so it was best don=
e
this way).

Regards

Robert Cross, Senior Systems Programmer, EDS (UK) Ltd.
DISCLAIMER: information contained herein is purely the responsibility o=
f
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
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp

=

--0__=EmQUhNPJ6YjlWWXWqcSgHula3foeOAegH7Os6pZELO8kVOEUSCFV4LsL--


This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.




More information about the SunHELP mailing list