From owner-freebsd-net@FreeBSD.ORG Mon May 21 18:29:01 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 771FE16A46D for ; Mon, 21 May 2007 18:29:01 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from smtp809.mail.ird.yahoo.com (smtp809.mail.ird.yahoo.com [217.146.188.69]) by mx1.freebsd.org (Postfix) with SMTP id CD3F113C455 for ; Mon, 21 May 2007 18:29:00 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: (qmail 1826 invoked from network); 21 May 2007 18:28:59 -0000 Received: from unknown (HELO ?192.168.1.2?) (thomasjudge@btinternet.com@86.140.150.175 with plain) by smtp809.mail.ird.yahoo.com with SMTP; 21 May 2007 18:28:59 -0000 X-YMail-OSG: XzkDj9kVM1mf3q9Pk5BMZHze13ViirxYiNSTjjA025eQ7fhA Message-ID: <4651E556.9020602@tomjudge.com> Date: Mon, 21 May 2007 19:30:46 +0100 From: Tom Judge User-Agent: Thunderbird 1.5.0.10 (X11/20070306) MIME-Version: 1.0 To: Sastry Tumuluri References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Detecting LINK_UP / LINK_DOWN events X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2007 18:29:01 -0000 Sastry Tumuluri wrote: > Friends, > > I am trying to catch and do some extra processing on LINK_UP and LINK_DOWN > events for my net interfaces (e.g., notify my admin, log the event, ...). > Tried this on both FreeBSD 6.1 and on FreeBSD 6.2. > > I tried using the devd.conf file with the following code (shows LINK_DOWN; > wrote similar stuff for LINK_UP): > > notify 10 { > match "type" "LINK_DOWN"; > action "logger -s alert: Caught LINK_DOWN on dev: $device-name > subsys: $subsystem"; > }; > > Didn't work. I tried the above with both strict match conditions (using > vendor, device and class matches) as well as very general (like the above). > Didn't work. > I ran killed devd and ran it in the foreground with "devd -dD". Then I > logged into a different pty and used > ifconfig lnc0 down #(lnc0 is my ethernet device). > devd doesn't even seem to catch the event (no output at all - both on > screen > and in syslog). > > > On the other hand, "nomatch" and "attach" messages do seem to get > through (I > wrote similar stuff for nomatch & attach, and they are showing up at bootup > and in syslog). > What could I be doing wrong? > Have you had a look at net/ifstated in ports? Tom