[SunHELP] syslog send a mail

Cloud L. Lee siyeclover at online.ie
Thu Jan 27 02:52:38 CST 2005


Thanks ,Simon

Yeah, I know it.
It'll write a message to the tty of root if root login,not send a mail 
to root.
It's not I want.

Simon Annear wrote:

> man syslog.conf
>
> *.alert                       root,operator
>
> is how you send all alert messages to root and operator
>
> Simon
>
> I guess you want
>
> Cloud L. Lee wrote:
>
>> Thanks ,James
>>
>> I have some application run on a v880, I seldom login in the v880.
>> So I wish the syslog can send error messages to me by mail when some
>> error occur.
>> My email client always runs.
>> I try to use
>> tail -f /var/adm/messages |grep "error" |mail root
>> but it doesn't work.
>> It can't send a new mail to root when new error occur.
>>
>> james wrote:
>>
>>> Logwatch is configurable, but I don't know how short you can make the
>>> interval.
>>>
>>> I think you are headed toward disaster. Just for kicks do this..
>>>
>>> tail -f /var/log/somelog|Grep "string" and watch the fun begin. Make it
>>> worse by using egrep -v and adding multiple match strings.
>>>
>>> You are going to topple your mail reader with a flood of crap. A ton of
>>> stuff is written to the logfiles. With a 24 hour interval with logwatch
>>> at least its all delivered in one email - sorted and in a digest style.
>>>
>>> Unless the system in question is bored (not doing much) you are looking
>>> at too much information to have every "match" entry mailed. And if you
>>> want to see *everything* in syslog you might actually overrun your
>>> mailserver and mail reader.
>>>
>>> If your goal is to just see whats going on, do it "live" with tail -f.
>>>
>>>
>>>  
>>>
>>


-- 
Cloud L. Lee



More information about the SunHELP mailing list