From owner-freebsd-questions@FreeBSD.ORG Sun Apr 11 17:13:31 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3F86106566B for ; Sun, 11 Apr 2010 17:13:31 +0000 (UTC) (envelope-from kraduk@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 489648FC15 for ; Sun, 11 Apr 2010 17:13:30 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so885503fgb.13 for ; Sun, 11 Apr 2010 10:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=lhNK9yf0HAKtgk0AZjupEQBRGAgeqtzrY0zYr6fR95Y=; b=Bv/IpkzPpw7EqlKv2ResSo+dtjq8JqfLyvO0D7XClxDAPrmkQ4nX5loGPeFbgoIbig GKsqXz/rV9tWr3rNNGJLUcDfOrFJAplCFMraR76RAKU9VUGyhGyYpxq1FoiHgTKQ0PfR GHwtHbgNIQMg//SPCvePeQetu5TXD95eFdd3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=lDETJGjxZXQB0H6Z6KQXX9hMmQwWff3z9LEVJ3KE4lBz8ddUq5btxXixjoIrzzpqvO bFbtKFdNfRoLD3S8kddOEbTZY8edxsCS+0jKc5/BibwdH3Vhe+d4NE3IRw1WhANuQNcs 3NmVSyI8uHOXFRImzyf8bGvXQnnVe77k/441c= MIME-Version: 1.0 Received: by 10.239.165.129 with HTTP; Sun, 11 Apr 2010 10:13:29 -0700 (PDT) In-Reply-To: References: <4BC168D8.7080900@webrz.net> Date: Sun, 11 Apr 2010 18:13:29 +0100 Received: by 10.239.137.197 with SMTP id m5mr244349hbm.62.1271006009338; Sun, 11 Apr 2010 10:13:29 -0700 (PDT) Message-ID: From: krad To: Doug Hardie Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jos Chrispijn , freebsd-questions@freebsd.org Subject: Re: Auto update X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 17:13:31 -0000 On 11 April 2010 08:41, Doug Hardie 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)