[syslog-ng] Must Restart syslog-ng to send email

Reaky Rok reakyrok at hotmail.com
Mon Jul 6 14:50:00 CEST 2009


Dear friends
           I have a small problem with my syslog-ng server, I use a configuration to filter mail from log file and forwerd it to perl script to send it, the configuration like the following:
=====================================================
source sme {file (/var/log/syslog-ng/servers/172.31.250.68/local7.log); };

destination maillog { program ("/usr/local/bin/syslog-mail-perl" );
 };
log {source(sme); destination(maillog); };
=====================================================

And the perl script like the following:
+++++++++++++++++++++++++++++++++++=
#!/usr/bin/perl -n
# thanks to Brian Dowling for an example with security in mind.

$TO = 'reaky at domain.com';
$FROM = $TO;

s/^//;

open(MAIL, "|/usr/sbin/sendmail -t");

print MAIL "EOT";
To: $TO
From: $FROM
Subject: SME Log Alert: $_

$_

EOT

close(MAIL);
+++++++++++++++++++++++++++++++++++++++

It worked very fine when I send to root user in the machine, But when I
tried to send to outside I found that I must restart syslog every time
to send the mails to sendmail, In another word it buffer the emails
tell I restart syslog-ng then It forwerd it to send mail and can see it
in the mail log.
Do you have any idea for that ?
Thanks

_________________________________________________________________
Windows Live™: Keep your life in sync. Check it out!
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20090706/60caa628/attachment.htm 


More information about the syslog-ng mailing list