lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

Change default SNMP port #518

Closed lextudio-support closed 2 hours ago

lextudio-support commented 2 hours ago

Hi,

Is there a way to change the SNMP port? As far as I can tell, the default port (0xa1 = 161) is always used and can't be modified.

Allowing it to be changed (similar to the timeout) could come in handy.

Thx.
-Trev

Original Reported Date: 2008-07-29T08:38:56.597-07:00 Original CodePlex Discussion Thread ID: 32475

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi Trev.

First, you can always modify #SNMP source code to achieve that :-)

Second, I want to explain on my implementation. Because most network devices outside who support SNMP monitor incoming SNMP packets at port 161, as a manager library, it is rational that #SNMP sends packets to 161 port by default.

Third, the only port number that can be changed in #SNMP is the trap listener port. Normally #SNMP trap listener component monitors port 162 on the local machine. But you can ask it to monitor another port.

BTW, do you have a network device that does require a change from port 161 to another? Which vendor designs such a model? If this vendor proves to be a major one in the market, I can do modifications in #SNMP to officially support the port overriding feature you asked.

Regards,

Lex

Original Posted Date: 2008-07-29T19:03:09.947-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi,

No, my devices all use 161 as the default but I'm also able to change it if I wanted.

Here's my situation:
I have a number of devices behind a router that I want to poll. I'm currently forwarding port 161 to one of the devices and am able to successfully poll that device. But, every time I want to poll a different device, I have to change the port forwarding. What I thought would be handy is to forward a different port for each of the other devices and just change the port number in #SNMP to poll those devices.

-Trev

Original Posted Date: 2008-07-31T11:44:41.383-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi, Trev,

I think I can update #SNMP library as you wish. Other people may come across similar issues like your case because I know devices behind routers are hard to manage. However, it will take extra time, so I can only add this feature after UnicornHorn Refresh (1.1).

-Lex

Original Posted Date: 2008-07-31T18:28:45.553-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Trev, latest news! The thing you want is added in Change Set 14851. However, this breaks the existing API since 0.5. Have a look at the Source Code tab above.

-Lex

Original Posted Date: 2008-08-02T06:55:01.13-07:00

lextudio-support commented 2 hours ago

Marked as Answer Date: 2013-10-06T21:14:02.777-07:00