LinuxQuestions.org
Register a domain and help support LQ
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 08-25-2009, 02:47 PM   #1
svik
LQ Newbie
 
Registered: Dec 2007
Location: MA
Distribution: RHEL3,4,5
Posts: 3

Rep: Reputation: 0
I want to disable logwatch on our RHEL servers to stop the logwatch mail


Hi all,

I need to once and for all tune our root mailbox input on our RHEL servers to keep the root mails down to a minimum.

I've set the /etc/crontab MAILTO var to null so that cron stops mailing root. Now I want to stop logwatch from loading up the root mailbox.

We have a number of monitoring apps in our environment so logwatch isn't really needed.

I've been poking at anacron and the /etc/cron.daily where the logwatch is a symlink to a logwatch.pl perl script.

If I remove the symlink to the logwatch.pl - will that effectively do want I want to do without screwing up anything else ? ( I don't want to turn sendmail off either. )

If anyone has a better idea for getting logwatch mail out of the mix , let me know.

Thx,
Stv
 
Old 08-25-2009, 02:50 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Why don't you uninstall logwatch ?
 
Old 08-25-2009, 03:09 PM   #3
svik
LQ Newbie
 
Registered: Dec 2007
Location: MA
Distribution: RHEL3,4,5
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the suggestion

Thanks for that. Any other ideas short of uninstalling it ?
 
Old 08-25-2009, 03:18 PM   #4
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
I have not tried this, but maybe leave mailto blank in /etc/crontab

Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Maybe even make logwatch.pl non-executable

Last edited by TBC Cosmo; 08-25-2009 at 03:21 PM.
 
Old 08-25-2009, 03:26 PM   #5
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by TBC Cosmo View Post
I have not tried this, but maybe leave mailto blank in /etc/crontab

Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
Maybe even make logwatch.pl non-executable
Or change mailto to "nobody" and make nobody mail to /dev/null (In the /etc/alias file)?

-C
 
Old 08-26-2009, 01:15 AM   #6
edenCC
Member
 
Registered: May 2006
Location: Gz,China
Distribution: RH,FB
Posts: 196
Blog Entries: 1

Rep: Reputation: 32
Quote:
Originally Posted by custangro View Post
Or change mailto to "nobody" and make nobody mail to /dev/null (In the /etc/alias file)?

-C
You can also set this variable to null like this:
$ crontab -l
..
MAILTO=""
..
 
Old 08-26-2009, 09:03 AM   #7
svik
LQ Newbie
 
Registered: Dec 2007
Location: MA
Distribution: RHEL3,4,5
Posts: 3

Original Poster
Rep: Reputation: 0
All set on the logwatch issue - Thanks

Hey all

thanks for the responses.
the mailto var in etc/crontab was already done to keep cron from mailing root. I think at this point the first reply I got is probably the way we'll go and just un-install logwatch. Thx
 
Old 08-26-2009, 09:18 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,777
Blog Entries: 54

Rep: Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977Reputation: 2977
The Logwatch cronjob is by default run out of /etc/cron.daily and it is a symbolic link to the actual Perl script. Ergo just removing the symlink should do.
 
Old 08-26-2009, 01:53 PM   #9
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Removing the symlink to logwatch.pl is probably the most elegant way to do this without causing other side effects. Keep in mind that if/when you upgrade the package it will likely recreate the symlink.

An alternative to all this is: forward root's mail to an email account you check regularly, and actually read the logwatch reports. Monitoring your system logs is a good way to get a feel for normal activity, and a good way to get advance warning when something odd is going on.
 
Old 08-27-2009, 01:34 PM   #10
jonesr
Member
 
Registered: Feb 2008
Location: Sacramento
Distribution: RHEL AS, mostly
Posts: 44

Rep: Reputation: 18
Or, you could just configure logwatch to send the reports whereever you want them, such as an entry in /etc/aliases to that pipes to /dev/null.

Override the default "MailTo = root" that appears in /usr/share/logwatch/default.conf/logwatch.conf by adding a "MailTo =" line in your local configuration file which is /etc/logwatch/conf/logwatch.conf.
 
Old 08-27-2009, 03:51 PM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Just wondering, why would you run logwatch on your system, if you don't want emails from the results?
Uninstall, it just uses resources.
 
  


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
Does logwatch run automatically? How can I reset logwatch? abefroman Linux - Software 4 06-17-2009 03:17 AM
logwatch cache files are not clearing out on RHEL 5.0 build. sombre1 Linux - General 2 11-04-2008 12:22 PM
logwatch on RHEL keeps saying files have changed laggerific Linux - Software 2 02-23-2006 02:46 PM
Logwatch - and NT Servers shadowknight Linux - Software 1 07-14-2005 04:50 PM
How to stop the redhat sending me e-mail called "LogWatch" automatically? chuanweizuo Red Hat 2 03-08-2005 10:19 AM


All times are GMT -5. The time now is 12:59 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration