Share

Yet Another Python SNMP module

Tracker: Patches

5 connecting to ports other than 161/netsnmp-5.2.1.2 - ID: 1268277
Last Update: Attachment added ( k3rni )

Although the documentation states plainly that
Session(peername, version, community, port) is the way
to go, I couldn't get it to connect to any other port
than the default 161.
The constructor definitely sets remote_port, which is
then ignored, because it the underlying net-snmp
library discards it and looks for a port in peername
("host:port" format). However, a check in the
constructor effectively combats this, as it calls
gethostbyname() on the passed name, which barfs if it's
written in that form. So, no way to specify a
nondefault port.

The patch attempts to fix this, by removing the
gethostbyname check, changing default port in the
constructor to None, and only setting it when it's
specified. The first change does the trick, the other
one might not matter, because the given port value will
probably be ignored (see above).


k3rni ( k3rni ) - 2005-08-24 14:01

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File ( 1 )

Filename Description Download
otherport.patch Download

Change ( 1 )

Field Old Value Date By
File Added 146807: otherport.patch 2005-08-24 14:01 k3rni