SNMP and PERL
Posted by cleo (cleo), 26 August 2004i've compiled a custom mib and integrated it to an agent. the problem is i can't seem to GET and SET requests to the generated OIDS...
i'd appreciate any help...
Posted by admin (Graham Ellis), 26 August 2004Hi Cleo, and welcome. With all the 000s of technologies around, no-one can be experts in them all and I'm on "thin ice" when it comes to SNMP. I suspect that's also going to apply to the other folks who answer here from time to time too ... but I did want to write and welcome you and let yo know your question is being read even if we can't provide a huge pile of help.
Dredging back in the past., I do remembe doing some SNMP work in Perl using the module from the CPAN that's designed to do all the hard internal work for you. Didn't seem clear from your post whether you're using a CPAN module or if you've got a "roll your own".
If you HAVE gone the route of rolling your own, then the most common cause of errors in protocol exchanges (this applies to any protocol / socket work) is problems with $| or autoflush ... you print something to the socket, but it remains in the buffers of the Perl program and doesn't actually get sent unless you turn autoflush on. Since Perl never outputs its request, no request is ever performed and you don't get a response ...
That's just a wild guess. Please do post a follow up with more information if youfeel I might have further clues even from the thin ice I stand on.
Posted by cleo (cleo), 26 August 2004Thanks for the welcome and the immediate response
I'm using the Net::SNMP module and I, too, am walking with on thin ice with SNMP being a newbie and all...
Anyway, with regards to the OIDS generated by the compiled MIB, I can SET a request to OID's whose MIB OBJECT TYPE SYNTAX is INTEGER and OCTET STRING. I'm not successful with those whose SYNTAX is SEQUENCE OF. In both cases, I still can't GET a request.
An example of the MIB code would be
I'd appreciate any help...
Posted by admin (Graham Ellis), 27 August 2004Alas, as I said in my previous post I really don't know any SNMP and so I'm not really able to thrown any light onto the problem you're having ... it's probably not the buffering issue that I made a wild guess about as you're using the CPAN module which I'm sure deals with that internally.
Posted by Custard (Custard), 3 October 2004Hi,
SNMP: Another horribly complicated technology that starts with 'Simple'
Perhaps this is a bit late, but can we see your code that does the SET and GET.
Have you tried snmpwalk etc. (comes with Linux, but you didn't say what OS you are using)
This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho