[syslog-ng]sending message by email
Ohrberg, Mick
Mick.Ohrberg@umb.com
Fri, 1 Feb 2002 10:43:44 -0600
Another method is to create a script called for instance syslog-ng-mail.sh,
containing
#!/bin/sh
while read line; do
echo $line | /usr/bin/mailx -s "$1" $2
done
...and then pipe all your matched messages to this script with two arguments
of the subject and email address to send to. This makes it very generic.
/Mick
> -----Original Message-----
> From: Stephen C Burns [mailto:sburns@farpointer.net]
> Sent: Friday, February 01, 2002 10:31 AM
> To: syslog-ng@lists.balabit.hu
> Subject: Re: [syslog-ng]sending message by email
>
>
>
> Assuming you have a comprehensive file with all of the messages in
> /var/log/$HOST/messages, just set up a nightly cron job to cat
> /var/log/$HOST/messages|mail your email
>
> At 09:47 AM 2/1/2002, you wrote:
> >I have been trying, unsuccessfully, to setup email
> notification of certain
> >log messages. The filters I am using are working great, but my email
> >notifications are empty.
> >What I would like is to receive an email with a subject line
> similar to
> >"Log notification for hostname" where hostname is the system
> the message
> >was received from, with the body of the email containing the
> log message.
> >Is anyone else doing this? Can you provide an example of
> your method, if so?
> >Or, can anyone give me any pointers on making this work?
> >
> >---
> >David Monk CCNA, MCSE
> ><mailto:david@purplebear.net>david@purplebear.net
> >
> >The more things change, the more they stay insane.
>
>
> _______________________________________________
> syslog-ng maillist - syslog-ng@lists.balabit.hu
> https://lists.balabit.hu/mailman/listinfo/syslog-ng
>