From owner-freebsd-questions@FreeBSD.ORG Thu Apr 30 13:32:30 2009 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 426831065678 for ; Thu, 30 Apr 2009 13:32:30 +0000 (UTC) (envelope-from mkhitrov@gmail.com) Received: from mail-gx0-f176.google.com (mail-gx0-f176.google.com [209.85.217.176]) by mx1.freebsd.org (Postfix) with ESMTP id EE5088FC19 for ; Thu, 30 Apr 2009 13:32:29 +0000 (UTC) (envelope-from mkhitrov@gmail.com) Received: by gxk24 with SMTP id 24so2636123gxk.19 for ; Thu, 30 Apr 2009 06:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Ua7rp/fjz1XRe52tGc9sv6mcf767RsaXjH9em2YBGhU=; b=wY8k8TMUQ+jS5T70ac/tx4tOQZWR0XRK9OWR2OpAf0OKi5tziaQIpLeiqpt6qEgtwA 4woaQx243CrjlFMLqbbqhGBgElbd5rR4TlT+iUy6rZIr1cndIFXvKYksvXcELx12FqYp vq5WC7sDzM/iGEFf07O3PW+zQFWXYQ2A2SsnY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=aFpKEg10va8gXHOx79yg8UcNZwx5N9qJGa1rFOKVW6liJlIZlO9IP25O2BajjTfJzr zHdZQJRh1mmUPIjaOexKWWTYUMbQHNH+IkE+I637pIGsKSE9yPKhgVgH1xmiB4vdeI2X ZU2UTDu3IdJM2kPkwymqVxvk84btvm4dseBOc= MIME-Version: 1.0 Received: by 10.90.74.7 with SMTP id w7mr196128aga.77.1241098349107; Thu, 30 Apr 2009 06:32:29 -0700 (PDT) In-Reply-To: <49F9A58D.7050107@ibctech.ca> References: <26ddd1750904270928g106c8d7dg72b6b3a09ffc0afa@mail.gmail.com> <26ddd1750904291049s22eb912dg81a105e5f783f44@mail.gmail.com> <49F8F255.6080508@avioc.org> <26ddd1750904300602g31c8d135lab0200f37ff6d4a2@mail.gmail.com> <49F9A58D.7050107@ibctech.ca> From: Maxim Khitrov Date: Thu, 30 Apr 2009 09:32:09 -0400 Message-ID: <26ddd1750904300632q625c2b3bkc0db5c9c1a140634@mail.gmail.com> To: Steve Bertrand Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Brandon Weisz , freebsd-questions@freebsd.org, Anton Yuzhaninov Subject: Re: bsnmpd vs net-snmp 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, 30 Apr 2009 13:32:30 -0000 On Thu, Apr 30, 2009 at 9:20 AM, Steve Bertrand wrote: > Maxim Khitrov wrote: >> On Wed, Apr 29, 2009 at 8:35 PM, Brandon Weisz wrote: > >>> I cant speak to the documentation, but this seems to limit it to listen= ing >>> on a single address: >>> >>> Example.. >>> >>> # open standard SNMP ports >>> begemotSnmpdPortStatus.192.168.2.254.161 =3D 1 >> >> Thanks, but I tried this already. It causes bsnmpd to listen on the >> given IP as well, but doesn't remove the *:* entry: >> >> root@gw1 [/root]# sockstat -l4 >> USER =C2=A0 =C2=A0 COMMAND =C2=A0 =C2=A0PID =C2=A0 FD PROTO =C2=A0LOCAL = ADDRESS =C2=A0 =C2=A0 =C2=A0 =C2=A0 FOREIGN ADDRESS >> root =C2=A0 =C2=A0 bsnmpd =C2=A0 =C2=A0 61251 4 =C2=A0udp4 =C2=A0 *:* = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *:* >> root =C2=A0 =C2=A0 bsnmpd =C2=A0 =C2=A0 61251 5 =C2=A0udp4 =C2=A0 127.0.= 0.1:161 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *:* >> >> The author suggested using "begemotSnmpdPortTable.0.0.0.0.161 =3D 1" and >> change the IP there, but this causes the following error: >> >> Apr 30 08:59:59 gw1 snmpd[78798]: unknown variable >> Apr 30 08:59:59 gw1 snmpd[78798]: =C2=A0 in file /usr/local/etc/bsnmpd.c= onf line 20 >> Apr 30 08:59:59 gw1 snmpd[78798]: error in config file > > Here's how I limit to a single address: > > host :=3D 208.70.106.1 > > # open standard SNMP ports > begemotSnmpdPortStatus.[$(host)].161 =3D 1 > begemotSnmpdPortStatus.127.0.0.1.161 =3D 1 > > # netstat -na | grep 161 > udp4 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 =C2=A00 =C2=A0208.70.106.1.161 = =C2=A0 =C2=A0 =C2=A0 *.* > udp4 =C2=A0 =C2=A0 =C2=A0 0 =C2=A0 =C2=A0 =C2=A00 =C2=A0127.0.0.1.161 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*.* Doesn't work for me, the grep command removes *:* entry from the output: root@gw1 [/root]# netstat -an Active Internet connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) udp4 0 0 127.0.0.1.161 *.* udp4 0 0 *.* *.* The 127.0.0.1 entry is added with "begemotSnmpdPortStatus.127.0.0.1.161 =3D 1", but the other entry is always there. Turn the daemon on and off to verify that it's bsnmpd (or use sockstat). - Max