From owner-freebsd-questions@FreeBSD.ORG Thu Apr 1 19:00:38 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 C086F1065678 for ; Thu, 1 Apr 2010 19:00:38 +0000 (UTC) (envelope-from psteele@maxiscale.com) Received: from server505.appriver.com (server505c.appriver.com [98.129.35.7]) by mx1.freebsd.org (Postfix) with ESMTP id 89EC38FC35 for ; Thu, 1 Apr 2010 19:00:38 +0000 (UTC) X-Policy: GLOBAL - maxiscale.com X-Policy: GLOBAL - maxiscale.com X-Primary: psteele@maxiscale.com X-Note: This Email was scanned by AppRiver SecureTide X-ALLOW: psteele@maxiscale.com ALLOWED X-Virus-Scan: V- X-Note: Spam Tests Failed: X-Country-Path: UNITED STATES->UNITED STATES->UNITED STATES X-Note-Sending-IP: 98.129.23.45 X-Note-Reverse-DNS: ht03.exg5.exghost.com X-Note-WHTLIST: psteele@maxiscale.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G179 G180 G181 G182 G186 G187 G198 G285 X-Note: Encrypt Rule Hits: X-Note: Mail Class: ALLOWEDSENDER X-Note: Headers Injected Received: from [98.129.23.45] (HELO HT03.exg5.exghost.com) by server505.appriver.com (CommuniGate Pro SMTP 5.3.2) with ESMTPS id 34930280; Thu, 01 Apr 2010 14:00:35 -0500 Received: from mbx03.exg5.exghost.com ([169.254.1.132]) by HT03.exg5.exghost.com ([10.242.228.75]) with mapi; Thu, 1 Apr 2010 14:00:36 -0500 From: Peter Steele To: Steve Polyack Date: Thu, 1 Apr 2010 14:00:36 -0500 Thread-Topic: Testing ethernet interface status Thread-Index: AcrRzQAXHj3wyxxzS5yH99pOyJodkwAADkhw Message-ID: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3B65FC97@MBX03.exg5.exghost.com> References: <7B9397B189EB6E46A5EE7B4C8A4BB7CB3B65FC5D@MBX03.exg5.exghost.com> <4BB4EC44.2070804@comcast.net> In-Reply-To: <4BB4EC44.2070804@comcast.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-questions@freebsd.org" Subject: RE: Testing ethernet interface status 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: Thu, 01 Apr 2010 19:00:38 -0000 >I was going to suggest that you look at the ifconfig(8) source code, but t= hen I did so myself - it looks like you're doing it pretty much exactly how= they are. I've never >noticed ifconfig(8) returning an incorrect value, n= ot to say it's not possible. > >Are you sure that nothing is causing interface state resets? i.e.=20 >mismatched duplex/speed settings between the FreeBSD machine and the switc= h? Have you checked dmesg(8) for logs of interface state changes? =20 >You can also check the output of 'netstat -i' to check for interface error= s. I should have added that when our own monitoring code flags one of these fa= lse positives, there is no entry in /var/log/messages indicating that the n= ic has gone offine. I added a second call to confirm that indeed the interf= ace is offline, and this second check seems to have largely solved the prob= lem, but we have seen a case where even two consecutive checks return false= positives. Maybe we need three tests?