Help - Search - Members - Calendar
Full Version: No longer getting daily LogWatch and Cron reports.
The Planet Forums > General > The Lounge
SuperBaby
SM earlier replaced my defective server with a completely new machine. Now I no longer get the daily LogWatch and Cron reports as I did when using the old server (without having to install it myself).

I can see /etc/log.d/scripts/logwatch.pl. But even if I execute it manually from ssh, I still do not get the email (I checked the mailto and it is correctly set to "root").
disoft
Check /etc/aliases and see where root's mail is directed to.

At the bottom of the file you should see postmaster's mail being directed to root, then root's mail needs to go to somewhere useful. For example:

CODE
postmaster: root



root: somewhere@yourdomain.com
SuperBaby
I can see this (and this is the last line in the file):
postmaster: root

But I cannot see this:
root: somewhere@yourdomain.com

Should I add it?
Antipas
CODE
# Pretty much everything else in this file points to "root", so

# you would do well in either reading root's mailbox or forwarding

# root's email from here.



#root: me@mydomain.com


In FreeBSD 4x

pico -w /etc/aliases

Near the top of the file change #root: me@mydomain.com

Remove the # and change to your e-mail
SuperBaby
I am on RH9, CPanel.

Should I add that line?
Antipas
QUOTE (SuperBaby)
I am on RH9, CPanel.

Should I add that line?



*shrug* sorry I only run FreeBSD with no Control panel. You would have to ask one of the redhat guru’s
disoft
QUOTE (SuperBaby)
I am on RH9, CPanel.

Should I add that line?


Yes, you should add a line that directs root's mail to somewhere useful.
SuperBaby
I tried adding that line but still I am not getting the LogWatch and Cron Daemon reports.

I tried running LogWatch using /usr/sbin/logwatch at the old and new server. I managed to get the email for the old server but not the new one. I compared the mailto address in logwatch.pl and the settings in /etc/aliases. They are the same. I have even changed the mailto address to a full email address but still no luck.

So it is quite obvious that the email sending is not working. However, I do get the report from chkrootkit.
Ferret_dude
i have the same problem no mail from the server ...
SuperBaby
Funny though .... I do not get the email reports for LogWatch and Cron Daemon but I do not have problems receiving email reports for chkrootkit.

LogWatch is a Perl script. The mailto is set in the script itself. I have tested setting it to "root" and "mail@mydomain.com" but still not getting the email. So to trace the error, we need to find out what mail sending method is used in the Perl script.
disoft
Try running something like:

CODE
cat somefile | mail -s"test" mailaccountyouknowworks@yourdomain.com


Replacing 'somefile' with any old filename (maybe something like /etc/log.d/logwatch.conf).

That should check to see if mail is being sent okay to an account you know works.

Then try:

CODE
cat somefile | mail -s"test" root@yourdomain.com


To see if mail is getting to the root account okay.

At least this will point out whether it's the mail function at fault or just the root e-mail address.
SuperBaby
I managed to get the email when I tried:

cat /usr/sbin/logwatch | mail -s "test" xxxx@domain.com

where xxxx@domain.com is my root email address. But I did not get any email when I tried:

cat /usr/sbin/logwatch | mail -s "test" root

Also, the email contains the source codes of the script instead of result output.
disoft
Yep, I'd expect it to contain the source code of the script; all 'cat' is doing is sending that file to an e-mail address.

Okay, so the 'mail' function works, but it's not going to root.

Now on my system it gets to root okay. Now this is what I have in my /etc/aliases file:

CODE
mailman-admin: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman admin mailman"

mailman-bounces: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman bounces mailman"

mailman-confirm: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman confirm mailman"

mailman-join: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman join mailman"

mailman-leave: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman leave mailman"

mailman-owner: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman owner mailman"

mailman-request: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman request mailman"

mailman-subscribe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman subscribe mailman"

mailman-unsubscribe: "|/usr/local/cpanel/3rdparty/mailman/mail/mailman unsubscribe mailman"

mailman: /dev/null

mailman-loopback: /dev/null

owner-mailman: mailman-admin



postmaster: root



root: root.server@mydomain.com


Does yours look similar?
SuperBaby
Yes, I have exactly the same thing except the last line. So I added:

root: mail@mydomain.com

Then I run /usr/sbin/logwatch from SSH. Still I am not getting the email.

For the chkrootkit, I have the same email address used but I managed to get the email.
disoft
How odd ... and you still don't receive e-mail if you specify the address directly in logwatch.conf?

i.e. MailTo = agoodaddress@mydomain.com
SuperBaby
I specified the email address in logwatch.pl. Can't find logwatch.conf. Where is the file logwatch.conf located?
disoft
It should be in /etc/log.d/conf/logwatch.conf
SuperBaby
OK, found the file logwatch.conf and changed mailto to a direct email address. I got the logwatch email report!

This is what the Tech just replied about this problem:
QUOTE
Do you show any entries in your mail server's mail log attempting to send the message? If so, was there an error message explaining why?

How do I read the mail log?

Also, how do I find the config file for the Cron Daemon?
SuperBaby
Do you think there is a mistake in this line in logwatch.conf:

# some systems have different locations for mailers
#
mailer = /bin/mail
disoft
I think the mail location should be okay as it defaults. It works when you specify a 'real' address.

You can find your various maillogs in /var/log/maillog and /var/log/exim_mainlog
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.