Re: multiple subagent with same set of oid.

2022-04-26 Thread Craig Small
On Wed, 27 Apr 2022 at 12:30, Paban Agarwalla 
wrote:

> Would you please share some examples of context?
>
> snmpd.examples has some good, well, examples but a way of using contexts
for overlapping OIDs is below. This is for two agents using the proxy
method as its easier to see the results.
This is a pretty wide access control so you would want to tighten it up in
prod.

The mapping is, no matter the OID:
127.0.0.1(public1) proxy to 127.0.0.11(public11)
127.0.0.1(public2) proxy to 127.0.0.12(public12)

com2sec -Cn ctx1 sec1 default public1
com2sec -Cn ctx2 sec1 default public2
proxy -Cn ctx1 -v 1 -c public11 127.0.0.11 .1.3
proxy -Cn ctx2 -v 1 -c public12 127.0.0.12 .1.3
group proxygrp v1 sec1
viewall included.1
access  proxygrpctx1any noauth  exact   all nonenone
access  proxygrpctx2any noauth  exact   all nonenone

Cut down wireshark output:
$ sudo tshark -i lo -f 'src 127.0.0.1 and udp port 161' -Osnmp -l
2>/dev/null | egrep '(Internet Protocol|Simple|community:|Object Name:|^$)'
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Simple Network Management Protocol
*community: public1*
Object Name: 1.3.6.1.4.1.42 (iso.3.6.1.4.1.42)

Internet Protocol Version 4, Src: 127.0.0.1, *Dst: 127.0.0.11*
Simple Network Management Protocol
*community: public11*
Object Name: 1.3.6.1.4.1.42 (iso.3.6.1.4.1.42)

and the second one:
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Simple Network Management Protocol
*community: public2*
Object Name: 1.3.6.1.4.1.42 (iso.3.6.1.4.1.42)

Internet Protocol Version 4, Src: 127.0.0.1, *Dst: 127.0.0.12*
Simple Network Management Protocol
   * community: public12*
Object Name: 1.3.6.1.4.1.42 (iso.3.6.1.4.1.42)

Same OID, different communities map internally to different contexts and
therefore to different remote proxy hosts.

 - Craig
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: multiple subagent with same set of oid.

2022-04-26 Thread Paban Agarwalla
Hi Wes,

Would you please share some examples of context?

Regards
Paban



On Fri, Apr 22, 2022 at 4:10 AM Wes Hardaker 
wrote:

> Paban Agarwalla  writes:
>
> > We are using to Netsnmp to collect statistics from our device.
> >
> > We are registering multiple subagents with the same set of oids.
> >
> > can i get all sub agent statastics using the same oid with v2c/v1 snmp
> > host?
>
> The only way to deal with problems like that is to use SNMPv3 contexts,
> where each context can map to a different subagent with overlapping OID
> registrations.  You can make v1/v2c communities to v3 contexts using the
> com2sec configuration tokens if you wish.
>
> --
> Wes Hardaker
> Please mail all replies to net-snmp-coders@lists.sourceforge.net
>
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: multiple subagent with same set of oid.

2022-04-24 Thread Paban Agarwalla
Hi Bill,

Would you please share the patch?

Regards
Paban

On Sun, Apr 24, 2022 at 10:13 PM Bill Fenner  wrote:

> If there's interest, I have a patch that allows communities of the form
> "community@context" to be treated by the snmp agent as separate community
> and context values, eliminating the need to define each combination as a
> valid community, and use com2sec to do the mapping.
>
> I hadn't upstreamed it previously because it would change the behavior for
> anyone who had an "@" in their community string.  Obviously giving it a
> configuration file entry to turn this behavior on would probably address
> that concern.
>
>   Bill
>
>
> On Thu, Apr 21, 2022 at 3:41 PM Wes Hardaker via Net-snmp-coders <
> net-snmp-coders@lists.sourceforge.net> wrote:
>
>> Paban Agarwalla  writes:
>>
>> > We are using to Netsnmp to collect statistics from our device.
>> >
>> > We are registering multiple subagents with the same set of oids.
>> >
>> > can i get all sub agent statastics using the same oid with v2c/v1 snmp
>> > host?
>>
>> The only way to deal with problems like that is to use SNMPv3 contexts,
>> where each context can map to a different subagent with overlapping OID
>> registrations.  You can make v1/v2c communities to v3 contexts using the
>> com2sec configuration tokens if you wish.
>>
>> --
>> Wes Hardaker
>> Please mail all replies to net-snmp-coders@lists.sourceforge.net
>>
>>
>> ___
>> Net-snmp-coders mailing list
>> Net-snmp-coders@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>
>
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: multiple subagent with same set of oid.

2022-04-24 Thread Bill Fenner
If there's interest, I have a patch that allows communities of the form
"community@context" to be treated by the snmp agent as separate community
and context values, eliminating the need to define each combination as a
valid community, and use com2sec to do the mapping.

I hadn't upstreamed it previously because it would change the behavior for
anyone who had an "@" in their community string.  Obviously giving it a
configuration file entry to turn this behavior on would probably address
that concern.

  Bill


On Thu, Apr 21, 2022 at 3:41 PM Wes Hardaker via Net-snmp-coders <
net-snmp-coders@lists.sourceforge.net> wrote:

> Paban Agarwalla  writes:
>
> > We are using to Netsnmp to collect statistics from our device.
> >
> > We are registering multiple subagents with the same set of oids.
> >
> > can i get all sub agent statastics using the same oid with v2c/v1 snmp
> > host?
>
> The only way to deal with problems like that is to use SNMPv3 contexts,
> where each context can map to a different subagent with overlapping OID
> registrations.  You can make v1/v2c communities to v3 contexts using the
> com2sec configuration tokens if you wish.
>
> --
> Wes Hardaker
> Please mail all replies to net-snmp-coders@lists.sourceforge.net
>
>
> ___
> Net-snmp-coders mailing list
> Net-snmp-coders@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


Re: multiple subagent with same set of oid.

2022-04-21 Thread Wes Hardaker via Net-snmp-coders
Paban Agarwalla  writes:

> We are using to Netsnmp to collect statistics from our device.
> 
> We are registering multiple subagents with the same set of oids.
> 
> can i get all sub agent statastics using the same oid with v2c/v1 snmp
> host?

The only way to deal with problems like that is to use SNMPv3 contexts,
where each context can map to a different subagent with overlapping OID
registrations.  You can make v1/v2c communities to v3 contexts using the
com2sec configuration tokens if you wish.

-- 
Wes Hardaker
Please mail all replies to net-snmp-coders@lists.sourceforge.net


___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


multiple subagent with same set of oid.

2022-04-11 Thread Paban Agarwalla
Hi,

We are using to Netsnmp to collect statistics from our device.

We are registering multiple subagents with the same set of oids.

can i get all sub agent statastics using the same oid with v2c/v1 snmp host?

Regards
Paban
___
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders