Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: Engelmann Florian 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
-
As far as I know there is "mutt" installed.
jochen
-
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
-
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
-
Thx - pine works fine! ill also try that script to get them weekly...
cu
-
How do you "put it in cron.weekly"?
Lee
-
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