Topic: I need some advice about mailing logs to my googlemail account

I'm running 4.3-STABLE as a home firewall/router/dhcp server ("home gateway").  I'm amazed I managed to get that far with my limited UNIX skills.  I would now like to have some logs regularly e-mailed to my googlemail account. but I don't know the first thing about how to do this.  Could someone please give me some advice as to what I need to do?  To be clear, sending those logs will be the only mail-related activity the home gateway will do.  Any advice will be appreciated.

Last edited by Shagbag (2008-11-02 10:07:49)

Re: I need some advice about mailing logs to my googlemail account

My first question is why would you want them emiled to you?

Log files are forever changing - at variable rates. You could end up emailing the same data (bar minor changes). Perhaps if you tell us why, there may be a better solution.

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: I need some advice about mailing logs to my googlemail account

Sure.  I'm running my gateway headless and I want to 'monitor' what's happened to it on a regular basis but I don't want to ssh into it in order to do so.  I would like it to send a copy of the authlog file (and maybe one or two others) to my googlemail address so that I can look at it anywhere I happen to be.  Ideally, I could (I'd need to do some investigating as shell scripting is not my bag, baby) make a script that would extract the changes since the last file was e-mailed so that I only get the incremental changes e-mailed.  I remember my Netgear ADSL Router let me do this, and I would like to do a similar thing now that OpenBSD has replaced the Netgear box.

Cheers

Re: I need some advice about mailing logs to my googlemail account

Sure, something crude and untested would be a cron'd task with a oneliner like this:

/bin/cat /var/log/authlog | mail -s 'Email of Authlog' me@gmail.com
"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: I need some advice about mailing logs to my googlemail account

/me presents WIntellect with a

Re: I need some advice about mailing logs to my googlemail account

I didn't know it could be so simple!  Thanks very much!

Re: I need some advice about mailing logs to my googlemail account

Maxlor wrote:

/me presents WIntellect with a

"UBER" means I don't drink the coffee... I chew the beans instead
             -- Copyright BSDnexus

Re: I need some advice about mailing logs to my googlemail account

Why don't you just redirect the default "daily security output" mails to your gmail account, by let's say, using a .forward file ?
# echo "youraddress@gmail.com" > /root/.forward

Let the system process the information for you.

Re: I need some advice about mailing logs to my googlemail account

which mtas support .forward ?

Re: I need some advice about mailing logs to my googlemail account

Better question is "which mtas don't support .forward?"  smile  If you know of one, let us know.

Re: I need some advice about mailing logs to my googlemail account

ok, so i'm assuming that sendmail, postfix, and qmail all support it.

Posts [ 11 ]

Pages 1

You must login or register to post a reply