RE: V3 OIDs returned in different format than V1

"Mike Ayers" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <83E753BE7B6A324ABB336245BAF1DAAC08EB9C75@mailserver.metatv-ds.metatv.com>
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Bradley Navarro

> I am seeing a strange issue with returning the OID that I 
> just walked using snprint_objid()  When I do a GETNEXT using 
> SNMP V1, the function returns the OID in a dotted number 
> notation (with the exception of the first number, which 
> always comes back as "iso"), so my OID returned looks like:  
> "iso.3.6.1.2.1.1.4.0"
>  
> However, when I do a GETNEXT using SNMP v3, snprint_objid() 
> returns the OID in a "MIB::oidname.number" format instead, 
> e.g. "SNMPv2-MIB::sysContact.0"

	Then v3/v1 is not the only difference between the two commands.  You have MIBs available in your v3 environment, but not your v1 environment.  Passing `-M ""` to your v3 getnext command will make it display the .iso.3 format.

> Does anyone know why I might be seeing such a discrepancy?  
> Unfortunately, other parts of the application have grown to 
> rely on the OID coming back in the "iso.3.6.1..." format, so 
> I would like to find a way at a minimum to get OIDs returned 
> from V3 walks to look like their V1 counterparts (however it 
> would actually be handy if I could get the OID to return in 
> *both* formats for V1 and V3).  How would I do this?

	`-M all`

	Make sure you have your MIBDIRS env var pointed to the right place.  See the snmpcmd man page for full details.  I recommend reading that page top to bottom.

> Interestingly, the snmpget utility that was built on my 
> machine at the same time I built the net-snmp client library 
> always returns this in a  "MIB::oidname.number" format, 
> regardless of the version of the protocol used.  

	That's `-OS`.  Now go read the page to show how thankful you are.  ;-)


	HTH,

Mike

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.