Koozali.org: home of the SME Server

simple question:

Engelmann Florian

simple question:
« on: August 10, 2001, 12:34:56 PM »
Hi,
how can i if remotly logged in send the /var/log/messages to an e-mail account?
is there a small email clinet installed with e-smith?

cu engelmann

Jochen Hoegerl

Re: simple question:
« Reply #1 on: August 10, 2001, 04:56:29 PM »
As far as I know there is "mutt" installed.

jochen

Geoff Bennion

Re: simple question:
« Reply #2 on: August 10, 2001, 07:28:03 PM »
you could use pine or mail, both will work (as I have done on many occasions)

Or you could use a web page to view the last n lines of the file.
(We currently do this to monitor memory, hdd, logfiles etc...)


Geoff Bennion

guestFF

Re: simple question:
« Reply #3 on: August 10, 2001, 11:08:42 PM »
Hi,

I made a small script that I put in cron.weekly.

This will e-mail me a copy of the /var/log/messages, /var/log/maillog and the /var/log/security every week automatically.

Here it is (no guarantees, but it works for me. It's not perfect)
---------------------------------------
#!/bin/sh
FROM_DOMAIN=yourdomain.com
MAIL_ADDRESS=you@yourdomain.com (or any)
ATTACH_FILE1=/var/log/messages.monitor
ATTACH_FILE2=/var/log/maillog.monitor
ATTACH_FILE3=/var/log/httpd/error_log.monitor
cp /var/log/messages $ATTACH_FILE1
cp /var/log/maillog $ATTACH_FILE2
cp /var/log/httpd/error_log $ATTACH_FILE3
mail -s "Star Support Monitor $FROM_DOMAIN: $ATTACH_FILE1" $MAIL_ADDRESS < $ATTACH_FILE1
mail -s "Star Support Monitor $FROM_DOMAIN: $ATTACH_FILE2" $MAIL_ADDRESS < $ATTACH_FILE2
mail -s "Star Support Monitor $FROM_DOMAIN: $ATTACH_FILE3" $MAIL_ADDRESS < $ATTACH_FILE3
exit 0
----------------------------------------

I would like to add an gziped attachment of the logs instead as a body. Anybody now how to do that..??

Thanks and good luck.

RequestedDeletion

Engelmann Florian

Re: simple question:
« Reply #4 on: August 11, 2001, 02:29:19 PM »
Thx - pine works fine! ill also try that script to get them weekly...

cu

Lee

Re: simple question:
« Reply #5 on: August 12, 2001, 05:21:00 AM »
How do you "put it in cron.weekly"?

Lee

guestFF

Re: simple question:
« Reply #6 on: August 12, 2001, 02:12:08 PM »
Hi Lee,

As far as I did it, I made a dir in /var/usr/scripts and put the script in there.
Then a made a symbolic link to the script in /etc/cron.weekly.

I'm not that good with Cron and scripts, but it works. If anybody has any suggestions, they are welcome.

Rehards,

HFW