a shot in the dark but...

the particular OID you're requesting might be 'filled-in' by the getting of a previous OID so if you try to get it without first getting the 'filler-in' OID it won't be there.

say this is the branch that reports disk space, xxx.1.1.0 is the name of the first disk, xxx.1.2.0 is the free-space. if you snmpwalk xxx.1 you'll get both values, but if you only snmpget xxx.1.2.0 it will fail. the disk agent fills in the 2.0 value at the same time it returns the 1.0 value.

things like this can also happen when trying to query interfaces that change. you can always successfully snmpwalk the interfaces table and get currently valid interfaces. if you snmpget the interface directly it might not be there anymore and you get an error.

try playing with snmpwalk 1.3.6.1.4 and go down as far as you can. you'll probably have to walk/bulk_walk the branch that would include the OID you want and throw away the data you don't want.


In reply to Re: Net::SNMP, get_table works, and get_request fails : why? by zengargoyle
in thread Net::SNMP, get_table works, and get_request fails : why? by remu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.