Hi,
  Wouldn't asynchronous queries do what you need? See
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Simple_Async_Application

I've written something similar but was using pysnmp and it seemed to do the
job.  The trick is you also have to make sure you don't hammer the agent;
most agents are pretty awful and lock up if you hammer them too much.  For
the reuse of the UDP port, you might need to go to socket level ioctls and
use SO_REUSEPORT. The danger is you can have only one and only one query
per agent.

 - Craig


On Sat, 2 Jan 2021 at 12:32, Ed Fair <quacksp...@gmail.com> wrote:

> I'm trying to write an SNMP manager using the net-snmp API.  The manager
> will use UDP in IPv4 and IPv6, and will be sending get-requests (and
> getbulk, and getnext) to 10000 agents (arbitrary number, but you get the
> idea - a relatively large number).  Is there any way to do this using just
> a single session?
>
> I've compiled and experimented with the demo apps, they seem to use one
> session per agent.
>
> Creating 10000 separate sessions seems excessive (as I understand, this
> would consume 10000 sockets and 10000 distinct SRC PORTS from my host).
>
> Creating/using/closing 10000 sessions seems excessive as well.
>
> The reason I'm going here:  my manager must interact with a firewall
> before sending any requests to any agents; a single firewall interaction
> identifying a single UDP source port would be much more desirable than
> 10000 firewall interactions identifying 10000 different UDP source ports.
>
> Thanks in advance for your comments.
> _______________________________________________
> 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

Reply via email to