SNMP over TCP
habit_forming
created: 2004-07-01 12:26:57
Oh great Learned Monks, please see fit to answer this question.

I need to use SNMP from perl over tcp. The module Net::SNMP does a fine job of this over udp but looks too tightly coupled with its supporting modules to be a good candidate for me to modify quickly.

I am looking for other options. Does anyone know of any SNMP perl clients/modules that support SNMP over TCP?

--habit
Re: SNMP over TCP
created: 2004-07-01 12:46:21
I've never heard of running SNMP over TCP. It seems that RFC 3417 hasn't either. What device are you trying to talk to that wants SNMP over TCP?

Update: Looks like I'm just plain wrong! Thanks gellyfish!

Re^2: SNMP over TCP
created: 2004-07-01 12:56:01

I've never heard of running SNMP over TCP. It seems that RFC 3417 hasn't either

Ah but RFC3430 has ;-)

BTW the rfc-editor site has a better search than faqs.org IMO :-)

/J\

Re: SNMP over TCP
created: 2004-07-01 22:21:18
There are two popular ways to do SNMP with Perl that I am aware of. The Net::SNMP module from CPAN is actually different from the module you get if you download the Net-SNMP (formerly ucd-snmp) source from http://net-snmp.sourceforge.net/ and build it.

I've used both in an extremely high-volume network management system, and ended up having to switch to Net-SNMP a year or so ago, due to some flakiness on snmpgets and traps. I might have had as many as 16 simutaneous snmpgets on this system with around 200 of them firing off spread across two minute intervals.

To be fair, I can't say the system libraries were known to be perfect, but it was pretty much a stock 7.2 setup. Net::SNMP (above) from CPAN is easier to use, where the Net-SNMP module implementation is more arcane.. but very stable for me, outbound traps to NetCool were clearly more reliable.

You're going to have to build Net-SNMP from source to use the Perl modules (you need to cd into the perl directory and do a separate make ; make install as well, after the main build). So, remove any debs/rpms/etc before you do that make install.

I can't recall if you could do TCP through Net::SNMP, but I know you can with the Net-SNMP (formerly ucd). Thanks for reading all this, hope it helped.

-vlad
Re^2: SNMP over TCP
created: 2004-07-02 16:31:08
Could you reply with some details on how you configured a Net-SNMP client (in C or Perl) to use TCP. I am at a loss to understand how it is done. Every client I have seen uses udp.

Thanks,

--habit
Re: SNMP over TCP
created: 2004-07-02 01:40:08
I don't see any reason why you want to use SNMP over TCP, its works pretty well using Net::SNMP module. If you want to optimize performance , use nonblocking mode in Net::SNMP module. Neeraj.
Re: SNMP over TCP
created: 2004-07-06 14:37:06
Alright I found it! Here is the deal. snmpwalk has an undocumented switch, -T. The -T switch is deprecated and points us to use the host form protocol:hostname . This means that TCP:my.server.net actually uses the snmp over tcp. This warning from the -T switch seems to be the only place the TCP:my.server.net host form is documented. Oh well, at least I know it now. =)

Since I don't have any problem with qx()'ing snmpwalk and parsing the output, this will do just fine.

--habit

perlmonks.org content © perlmonks.org and gellyfish, habit_forming, neeraj, sgifford, vladdrak

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03