SNMP API's - SNMP

This is a discussion on SNMP API's - SNMP ; Hello, I have done a simple walk program using the SNMP API functions. I can get a list of all OID's and their values starting with a root node. So, for example, If I type in 1.3.6.1.2.1.1, I will get ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: SNMP API's

  1. SNMP API's

    Hello,
    I have done a simple walk program using the SNMP API functions. I can get a
    list of all OID's and their values starting with a root node. So, for
    example, If I type in 1.3.6.1.2.1.1, I will get 1.3.6.1.2.1.1.1.0 through
    1.3.6.1.2.1.1.7.0 (the standard walk stuff). My questions is how do I get
    the label, or variable name, or what ever it is called for each OID?
    1.3.6.1.2.1.1.1.0 is sysDescr, ...2.0 is sysObjectID, etc. Has anyone every
    retrieved this information in Code using the SNMP API functions? I'd like to
    display something English-like rather than the OID.
    Thanks!
    Chris



  2. Re: SNMP API's

    The name is defined in MIB file, and the resolution work is done by a
    MIB browser. Anyway, if you really want to print them in you source
    code, you can use another mapping table.


  3. Re: SNMP API's

    answer of your question is very tricky.
    As we have a file ( other than mibs ) which have mapping between OID
    and respective object.

    This file is generated by a script ( which parse all the mib and get a
    tree) . I dont know whether your system would have this kind of file.

    The tool we use here to do above is "mgrtool". I dont know about any
    free tool for same. Probably someone else can throw light on this

    Abhishek


  4. Re: SNMP API's

    Chris Hastings wrote:

    > I have done a simple walk program using the SNMP API functions. I can get
    > a list of all OID's and their values starting with a root node. So, for
    > example, If I type in 1.3.6.1.2.1.1, I will get 1.3.6.1.2.1.1.1.0 through
    > 1.3.6.1.2.1.1.7.0 (the standard walk stuff). My questions is how do I get
    > the label, or variable name, or what ever it is called for each OID?
    > 1.3.6.1.2.1.1.1.0 is sysDescr, ...2.0 is sysObjectID, etc. Has anyone ever
    > retrieved this information in Code using the SNMP API functions? I'd like
    > to display something English-like rather than the OID.


    The protocol only deals with OIDs. You have to relate these OIDs to the
    definitions contained in MIB modules. The libsmi is a MIB module parser
    library which provides a C API. You can either link your tool against
    libsmi and use the API or you write a backend for the smidump compiler
    (which ships with libsmi) to produce an intermediate format that you
    embed in whatever way you like into your code.

    /js

    --
    Juergen Schoenwaelder International University Bremen
    P.O. Box 750 561, 28725 Bremen, Germany

+ Reply to Thread