LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 04-05-2008, 08:21 AM   #1
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Rep: Reputation: 15
logwatch email notification


How Can i configure linux systems to send the output of logwatch command to my e-mail address.Our sendmail is running on another system.


The scenario is :

We have configured our mail server on RHEL-5 whose FQDN is mail.abc.com.

We want to run logwatch command on DNS server( named as test.jewel.com) and send the output of logwatch command to skumar@abc.com address by using mail.abc.com mail server.What I configued is as below:

DNS Linux server:

# vi /etc/hosts
172.16.1.9 mail.abc.com

vi /etc/mail/sendmail.mc
define(`SMART_HOST',`mail.abc.com')

vi /etc/mail/genericstable
sachin skumar@abc.com

vi /etc/mail/sendmail.mc
FEATURE(masquerade_envelope)dnl
FEATURE(`genericstable')dnl
GENERICS_DOMAIN(`localhost.localdomain')dnl

make -C /etc/mail
# service sendmail restart

On sendmail server:

vi /etc/mail/access
connect:10.1.1.50 RELAY (address of DNS server)

In the other server , I have edited the /usr/share/logwatch/default.conf/logwatch.conf file and set MailTo = skumar@abc.com.

Now when i execute logwatch command from DNS server, I didnot receive any mail on skumar@abc.com address.Instead mail stuck in /var/spool/mqueue directory of mail server and output generated is as :

V8
T1207393026
K1207393028
N1
P120495
I253/0/3346572
MDeferred: Connection refused by abc.com.jewel.com.
Fbs
$_[172.16.5.138]
$rESMTP
$stest.jewel.com
${daemon_flags}
${if_addr}172.16.1.19
S<root@test.jewel.com>
MDeferred: Connection refused by abc.com.jewel.com.
rRFC822; skumar@abc.com.jewel.com
RPFD:<skumar@abc.com.jewel.com>
H?P?Return-Path: <<81>g>
H??Received: from gold.jewel.com ([172.16.5.138])
by mail.7i.com.sa (8.13.8/8.13.8) with ESMTP id m35Av66i031055
for <skumar@abc.com.jewel.com>; Sat, 5 Apr 2008 13:57:06 +0300
H??Received: from test.jewel.com (test.jewel.com [127.0.0.1])
by test.jewel.com (8.13.8/8.13.8) with ESMTP id m35Aw0Er017700 "qfm35Av66i031055" [converted] 34L, 1178C

what should I do so that the output of logwatch command can be forwarded to skumar@abc.com using mail server,mail.abc.com ?

Can you recommend any other command/feature ?
 
Old 04-05-2008, 01:05 PM   #2
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
why not just edit /etc/cron.daily/0logwatch
Code:
$Config{'mailto'} = "skumar@abc.com";
 
Old 04-06-2008, 03:05 AM   #3
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
logwatch

If I enter $Config{'mailto'} = "skumar@abc.com";, line, message appeared is When i run logwatch command :


Possible unintended interpolation of @7 in string at /usr/sbin/logwatch line 64.

So I removed @abc.com and logwatch command ran successfully ,but problem still there.


[root@gold ~]# tail /var/log/maillog
Apr 6 10:01:04 gold sendmail[6307]: m36714gM006306: to=<skumar@gold.jewel.com>, ctladdr=<root@gold.jewel.com> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=56993, dsn=2.0.0, stat=Sent

where gold.jewel.com is the FQDN of the same system.I add this line in /etc/aliases file

skumar skumar@abc.com

but problem still same.How can I specify mail server address to use to send mail to that adderss .

Last edited by sachin1361; 04-06-2008 at 03:07 AM.
 
Old 04-06-2008, 03:16 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why not change that line to
Code:
$Config{'mailto'} = "logwatch_recipient";
Then in /etc/aliases (assuming that's where your alias file is)

Code:
logwatch_recipient: skumar@abc.com
And don't forget to newalias/postalias /etc/aliases (depending on mta)

Edit
Sorry - clearly didn't read all your post, but note that you are missing the colon in your alias entry

Last edited by billymayday; 04-06-2008 at 03:18 AM.
 
Old 04-08-2008, 04:47 AM   #5
sachin1361
Member
 
Registered: Feb 2007
Posts: 126

Original Poster
Rep: Reputation: 15
logwatch

Is sendmail needed to be configured on localhost to send this e-mail?

If mail server is already running, cannot we use remote smtp port , without enabling local smtp services ?
 
Old 05-29-2008, 08:52 AM   #6
rholme
Member
 
Registered: May 2008
Posts: 47

Rep: Reputation: 15
another simpler approach (maybe)

since logwatch is normally sent to root as well as perhaps other things you might want to watch, why not change the line in /etc/aliases for root to send you the mail to where you want it (or multiple places) - e.g.

root: user1@fubar.com,user2@fubest.com

(don't forget to run newaliases)

This picks up the logwatch and any other things that get posted to root - which can be very interesting if you are looking for problems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logwatch - duplicate email aolong Linux - Server 3 09-11-2007 01:41 PM
Logwatch can't email me soren625 Linux - General 15 12-16-2004 12:02 PM
Aaaaahhh!!! I Just Want To Receive A Logwatch Email!!!!! soren625 Linux - General 1 12-11-2004 07:37 PM
logwatch no longer send me an email paperdiesel Linux - Software 0 08-25-2004 09:51 AM
New Email Notification lapthorn Linux - Software 0 02-04-2004 10:44 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration