Multiple GETs with invalid OID - SNMP

This is a discussion on Multiple GETs with invalid OID - SNMP ; I am working on an application that uses SNMP (net-snmp) to query data from NTCIP-ESS weather stations. The variables to poll are defined in an XML file and are derived from the ESS MIB table. When variables are polled, the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Multiple GETs with invalid OID

  1. Multiple GETs with invalid OID

    I am working on an application that uses SNMP (net-snmp) to query data
    from NTCIP-ESS weather stations. The variables to poll are defined in
    an XML file and are derived from the ESS MIB table. When variables
    are polled, the application will attempt to request up to ten OIDs at
    a time in order to conserve bandwidth. I have run into cases,
    however, when one or more OIDs are not supported by the device. The
    result is that the entire query appears to be rejected.

    The only solution that I can come up with is to request variables one
    at a time and substitute default values for variables that are not
    supported. Is this the only solution available or is there one which
    I have overlooked?

    Regards,

    Jon Trauntvein


  2. Re: Multiple GETs with invalid OID

    In article <1195070509.698182.295850@s15g2000prm.googlegroups. com>,
    Jon wrote:
    >I am working on an application that uses SNMP (net-snmp) to query data
    >from NTCIP-ESS weather stations. The variables to poll are defined in
    >an XML file and are derived from the ESS MIB table. When variables
    >are polled, the application will attempt to request up to ten OIDs at
    >a time in order to conserve bandwidth. I have run into cases,
    >however, when one or more OIDs are not supported by the device. The
    >result is that the entire query appears to be rejected.
    >
    >The only solution that I can come up with is to request variables one
    >at a time and substitute default values for variables that are not
    >supported. Is this the only solution available or is there one which
    >I have overlooked?
    >
    >Regards,
    >
    >Jon Trauntvein


    Hi Jon,

    I think you can do better than having to send a single OID per request
    by using the error-status and error-index fields of the response. Just
    send the requests with (for example) 10 OIDs - when you get the response,
    if there's an error, the value in error-index will tell you which OID the
    agent didn't like. Remove JUST THAT OID and send the request again. If
    another variable isn't supported, you'll just repeat the process until only
    valid OIDs are included in the request (and you've kept track of which
    OIDs were rejected). You'll still never have to send more requests than
    you would have if you sent them one OID at a time, but most of the time
    you'll have optimized your bandwidth.

    Patrick
    ========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
    Patrick Klos Email: patrick@klos.com
    Klos Technologies, Inc. Web: http://www.klos.com/
    ================================================== ==========================

  3. Re: Multiple GETs with invalid OID

    Patrick Klos wrote:
    > In article <1195070509.698182.295850@s15g2000prm.googlegroups. com>,
    > Jon wrote:


    >> [...] When variables
    >>are polled, the application will attempt to request up to ten OIDs at
    >>a time in order to conserve bandwidth. I have run into cases,
    >>however, when one or more OIDs are not supported by the device. The
    >>result is that the entire query appears to be rejected.


    It seems you are using SNMPv1. In SNMPv2c or SNMPv3, the agent can
    return an exception instead of failing the request. However, the
    agent does not have to - it may still decided to fail the request.
    But it might be worth a try.

    >>The only solution that I can come up with is to request variables one
    >>at a time and substitute default values for variables that are not
    >>supported. Is this the only solution available or is there one which


    > I think you can do better than having to send a single OID per request
    > by using the error-status and error-index fields of the response. Just
    > send the requests with (for example) 10 OIDs - when you get the response,
    > if there's an error, the value in error-index will tell you which OID the
    > agent didn't like. Remove JUST THAT OID and send the request again. If
    > another variable isn't supported, you'll just repeat the process until only
    > valid OIDs are included in the request (and you've kept track of which
    > OIDs were rejected). You'll still never have to send more requests than
    > you would have if you sent them one OID at a time, but most of the time
    > you'll have optimized your bandwidth.


    Another option that can work is to simply avoid using Get request. If
    the instance identifiers are predictable (e.g. if you have scalars or
    columnar objects with rather static instance identifers), then you can
    use a GetNext request to get the data. For example, to read sysUpTime.0
    and sysDescr.0, you can set a GetNext(sysUpTime, sysDescr) and if any
    of the scalars is not in view, you will simply get some other
    lexicographic following object (unless there is no other object). I
    am almost never using Get to read scalars since this GetNext "trick"
    almost always does the job with one interaction and without a probing
    loop on the manager side and with any version of SNMP.

    /js

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

+ Reply to Thread