Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
20.9.2014 - We have just updated our course layouts and descriptions and added our 2015 schedule.

SNMP and PERL

Posted by cleo (cleo), 26 August 2004
i'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 2004
Hi 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 2004
Thanks 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
Code:
     
unicRecordingStatus OBJECT-TYPE
  SYNTAX         SEQUENCE OF    UnicRecordingStatusEntry
  MAX-ACCESS       not-accessible
  STATUS                    current
  DESCRIPTION      "A"
  INDEX                    { unicSelectedCameraNumber }
::= { unic 2 }

unicRecordingStatusEntry OBJECT-TYPE
  SYNTAX            UnicRecordingStatusEntry
  MAX-ACCESS      not-accessible
  STATUS            current
  DESCRIPTION      "-"
  INDEX       { unicSelectedCameraNumber }
::= { unicRecordingStatus 1 }
     
UnicRecordingStatusEntry ::= SEQUENCE {
  unicSelectedCameraNumber      INTEGER,
 unicCameraStatus            INTEGER
     }
           
unicSelectedCameraNumber OBJECT-TYPE
  SYNTAX            INTEGER{
                 camera1 (1),
                 camera2 (2),
                 camera3 (3)                  }            
  MAX-ACCESS      read-write
  STATUS            current
  DESCRIPTION      "Selected Camera Number"
::= { unicRecordingStatusEntry 1 }


     

I'd appreciate any help...
Thanks....

Posted by admin (Graham Ellis), 27 August 2004
Alas, 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 2004
Hi,

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)

B



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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho