Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 09:39:16 -0400
From:      Steve Bertrand <steve@ibctech.ca>
To:        Maxim Khitrov <mkhitrov@gmail.com>
Cc:        Brandon Weisz <lists@avioc.org>, freebsd-questions@freebsd.org, Anton Yuzhaninov <citrin@citrin.ru>
Subject:   Re: bsnmpd vs net-snmp
Message-ID:  <49F9AA04.3060005@ibctech.ca>
In-Reply-To: <26ddd1750904300632q625c2b3bkc0db5c9c1a140634@mail.gmail.com>
References:  <26ddd1750904270928g106c8d7dg72b6b3a09ffc0afa@mail.gmail.com> <gt4svl$2ot$1@ger.gmane.org> <26ddd1750904291049s22eb912dg81a105e5f783f44@mail.gmail.com> <49F8F255.6080508@avioc.org> <26ddd1750904300602g31c8d135lab0200f37ff6d4a2@mail.gmail.com> <49F9A58D.7050107@ibctech.ca> <26ddd1750904300632q625c2b3bkc0db5c9c1a140634@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Maxim Khitrov wrote:
> On Thu, Apr 30, 2009 at 9:20 AM, Steve Bertrand <steve@ibctech.ca> wrote:
>> Maxim Khitrov wrote:
>>> On Wed, Apr 29, 2009 at 8:35 PM, Brandon Weisz <lists@avioc.org> wrote:
>>>> I cant speak to the documentation, but this seems to limit it to listening
>>>> on a single address:
>>>>
>>>> Example..
>>>>
>>>> # open standard SNMP ports
>>>> begemotSnmpdPortStatus.192.168.2.254.161 = 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 Â  Â  COMMAND Â  Â PID Â  FD PROTO Â LOCAL ADDRESS Â  Â  Â  Â  FOREIGN ADDRESS
>>> root     bsnmpd     61251 4  udp4   *:*                   *:*
>>> root     bsnmpd     61251 5  udp4   127.0.0.1:161         *:*
>>>
>>> The author suggested using "begemotSnmpdPortTable.0.0.0.0.161 = 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]: Â  in file /usr/local/etc/bsnmpd.conf line 20
>>> Apr 30 08:59:59 gw1 snmpd[78798]: error in config file
>> Here's how I limit to a single address:
>>
>> host := 208.70.106.1
>>
>> # open standard SNMP ports
>> begemotSnmpdPortStatus.[$(host)].161 = 1
>> begemotSnmpdPortStatus.127.0.0.1.161 = 1
>>
>> # netstat -na | grep 161
>> udp4 Â  Â  Â  0 Â  Â  Â 0 Â 208.70.106.1.161 Â  Â  Â  *.*
>> udp4 Â  Â  Â  0 Â  Â  Â 0 Â 127.0.0.1.161 Â  Â  Â  Â  Â *.*
> 
> 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 *.*                    *.*
> <snip>
> 
> The 127.0.0.1 entry is added with
> "begemotSnmpdPortStatus.127.0.0.1.161 = 1", but the other entry is
> always there. Turn the daemon on and off to verify that it's bsnmpd
> (or use sockstat).

I see now what you are saying:

# sockstat -l4

root     bsnmpd     2857  5  udp4   *:*                   *:*
root     bsnmpd     2857  6  udp4   127.0.0.1:161         *:*
root     bsnmpd     2857  7  udp4   208.70.106.1:161      *:*

I don't think I've ever seen a "*.*" in the local addr field before.

Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49F9AA04.3060005>