remu has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm doing some SMNP queries using the Net::SNMP package, SNMP v1 and the 'public' community to get infos from a solaris system. When I do a get_table( -baseoid => '1.3.6.1' ); I get a bunch of entries, like :

So far, so good.

But when I try to get those exact same values, using the exact same SMNP session object used for my get_table request but by a get_request this time, I can only get some of those SMNP entries:

in fact, I'm not able to issue any get_request on any node under the 1.3.6.1.4 tree. Anyone had this porblem or knows why one query works while the other fails ???
  • Comment on Net::SNMP, get_table works, and get_request fails : why?

Replies are listed 'Best First'.
Re: Net::SNMP, get_table works, and get_request fails : why?
by zengargoyle (Deacon) on Jan 30, 2003 at 00:45 UTC

    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.

Re: Net::SNMP, get_table works, and get_request fails : why?
by selena (Acolyte) on Jan 29, 2003 at 21:08 UTC
    does it work if you use snmpget from the command-line?