From owner-freebsd-net@FreeBSD.ORG Tue May 22 09:19:16 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 30C0116A47C for ; Tue, 22 May 2007 09:19:16 +0000 (UTC) (envelope-from sastry.tumuluri@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.177]) by mx1.freebsd.org (Postfix) with ESMTP id DF31413C4B0 for ; Tue, 22 May 2007 09:19:15 +0000 (UTC) (envelope-from sastry.tumuluri@gmail.com) Received: by py-out-1112.google.com with SMTP id f31so2103364pyh for ; Tue, 22 May 2007 02:19:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:reply-to:to:cc:references:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole:from:sender; b=lcnS/2By3Pfj5Ez042agD3WYgSjL5rNashyPMvmAqqyc3QeeJD+zk/yR1B+ZSy2/rp62a/PUQJ/7LmQMhv7T9n2W3nb5s1cinMRZu+ZyMxRVCQu5CNt/BhfbnCQeBPeqbqk9C0v5Ea4/ZfQoohVeLuc8gDlVmABlnCQyY7Azi0M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:reply-to:to:cc:references:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole:from:sender; b=NU1/Amvd7wPuy82JrPM5vOPaGXcVVMk2HX6SxdIoScuOKeP5Mr12aJWeTN3KsFNt4jd4mmcthTvaDvPUdKdX2p4FcxTTDAKvL0kTR57ow1Qopyu8GzlxKyjpAfI+1b0krqbS8Cb5Xdokse0sXqvjEYrS0kmQeNuVMjdAK9oeQdw= Received: by 10.35.94.2 with SMTP id w2mr10448137pyl.1179825554814; Tue, 22 May 2007 02:19:14 -0700 (PDT) Received: from HarryPurvis ( [121.247.124.90]) by mx.google.com with ESMTP id 18sm23079975nzo.2007.05.22.02.19.09; Tue, 22 May 2007 02:19:13 -0700 (PDT) To: "'Tom Judge'" References: <4651E556.9020602@tomjudge.com> Date: Tue, 22 May 2007 14:49:12 +0530 Message-ID: <003c01c79c52$476214d0$7b9ba8c0@HarryPurvis> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <4651E556.9020602@tomjudge.com> Thread-Index: Aceb1eqfF7gxQ1xPTH2isIv22sCPVgAe12wA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 From: Sastry Tumuluri Sender: Sastry Tumuluri 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 Reply-To: sas3@tumuluri.name List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2007 09:19:16 -0000 > -----Original Message----- > From: Tom Judge [mailto:tom@tomjudge.com] > Sent: Tuesday, May 22, 2007 12:01 AM > To: Sastry Tumuluri > Cc: freebsd-net@freebsd.org > Subject: Re: Detecting LINK_UP / LINK_DOWN events > > 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 > Thanks, Tom! Though I had not heard of ifstated before this, it looks interesting. I've managed to quickly get the latest port and install it without any hassles - but am still a bit short on documentation - esp., how the .conf file works, and how to make ifstated work for me. I haven't used carp so far; and am not sure whether I need to, if all I want is a simple "notification / logging". Any suggestions? On the other hand, I am still curious why devd didn't work in the first place. Is it a "futuristic" feature already advertised (in the devd.conf file, there are examples of LINK_UP/LINK_DOWN that make it look like it should work)? Or a case for better documentation? Regards, ==Sas3== No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date: 5/21/2007 2:01 PM