Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » All Things Unix » Sending emails via syslog-ng
Search Topic:
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Friend Asked Me For Some Unix Help »
« Virtual box host only ethernet adaptor  
AuthorAll Replies

reaky

join:2004-01-18
Killeen, TX


3 edits
reply to reaky
Sending emails via syslog-ng

Dear SirMeowmix_III
I take some of your Idea and modified it, and use 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@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);
+++++++++++++++++++++++++++++++++++++++
When It tried to send emails 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
-
Forums » Tech and Talk » OS and Software » All Things UnixFriend Asked Me For Some Unix Help »
« Virtual box host only ethernet adaptor  


Saturday, 28-Nov 10:21:17 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [122] Time Warner Cable Fires Broadside At Broadcasters
· [112] New AT&T Ad Campaign Hits Back At Verizon
· [96] Apple Joins AT&T Verizon Snark Fest
· [87] New Bill Takes Aim At Higher Verizon ETFs
· [72] TiVo Sees Record Customer Losses
· [69] In-Flight Internet Headed For Bumpy Landing?
· [69] Verizon CEO: Hulu Will Be Dead Soon
· [62] Thanksgiving Open Thread
· [54] Weekend Open Thread
· [40] EFF Wages War On Fine Print
Most people now reading
· Motion Sickness Solutions? [General Questions]
· Windows 7 boot manager editing questions [Microsoft Help]
· Using AirMax to provide triple play services? [Wireless Service Providers]
· Why does it take so long? Mail question [General Questions]
· Hosts file attributes set to system and hidden [Security]
· Not strictly "Home" related - but WOW anyways... [Home Repair & Improvement]
· [Newsgroups] Newzleech down? [Filesharing Software]
· What to use while demonoid is down? [Filesharing Software]
· [Vista] Why is HD So Full? [Microsoft Help]
· Is Gear Score now the new requirement to get pug invite? [World of Warcraft]