Date: Sun, 11 Apr 2010 18:13:29 +0100 From: krad <kraduk@googlemail.com> To: Doug Hardie <bc979@lafn.org> Cc: Jos Chrispijn <kernel@webrz.net>, freebsd-questions@freebsd.org Subject: Re: Auto update Message-ID: <k2xd36406631004111013zd1f157bai94d0af29d2c19933@mail.gmail.com> In-Reply-To: <F02E5989-F279-4059-9858-EF36FDA726FC@lafn.org> References: <4BC168D8.7080900@webrz.net> <F02E5989-F279-4059-9858-EF36FDA726FC@lafn.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 11 April 2010 08:41, Doug Hardie <bc979@lafn.org> wrote: > > On 10 April 2010, at 23:14, Jos Chrispijn wrote: > > > Can someone tell me if there is a way of generating an email on the > moment that someone logs in to my FreeBSD server? The mail part (phpmail) > will be easy; I don't know yet how to trigger and pass parameter to this > script or redirect info to a file (that I then send by email). Thanks. > > A cheesy way to do that is to use a popen ("tail -f /var/log/auth.log", > "r") and then read that. It will give you every login regardless of ssh, > telnet etc. You could then generate the emails from that. I have no idea > just how resource intensive this might be. You would also have to ensure it > got started by rc during boot._________________________ It shouldn't be to bad as I use that method to generate stats from log files for snmp. The log files I tail have about 200 odd lines per second and the boxes handle it fine. But they are decentish spec but not extravagant (dell 2850 with 4gig ram)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?k2xd36406631004111013zd1f157bai94d0af29d2c19933>