Re: snmpget and snmpwalk return corrupt string instead of hex string when MAC address starts with non zero
Fulko Hew <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jul 14, 2010 at 12:16 PM, Randall C Grimshaw <[email protected]>wrote: > Fulko: > > > > Your assistance is greatly appreciated. > > > > I apologize for making you want to don the lawyers hat, that was not my > intention. But could you find your technicians hat for a moment. > ... snip ... > Can you suggest what might be causing these MAC to display badly? Or > perhaps how to add a DISPLAY-HINT to the RFC1213-MIB for > ipNetToMediaPhysAddress? Or perhaps … ??? > OK, so I put on my "parnoid programmer's" hat instead... poking around on my system I tried: # snmpwalk -c public -v1 localhost ipNetToMediaPhysAddress IP-MIB::ipNetToMediaPhysAddress.2.10.20.101.1 = STRING: 0:13:60:d:3d:90 OK, it 'looks' like it used the DISPLAY-HINT. I read the man page on snmpcmd, and its says that -Ox... "This option does not affect objects that do have a Display Hint." ... so a DISPLAY-HINT _should_ cause the formatting to be 'good'. Ah, but the ipNetToMediaPhysAddress variable (in the MIB file) doesn't have DISPLAY-HINT, so I guess the other thing it says must be taking effect Reading further I see: "By default, the library attempts to determine whether the value is a printable or binary string, and displays it accordingly." So I used my hammer, and thought that the only way to avoid the heuristics could be to disable the reading of the MIB file, so that it couldn't determine if there was a hint, or not! So I tried: # snmpwalk -c public -v1 -m xxx localhost 1.3.6.1.2.1.4.22.1.2 Cannot find module (xxx): At line 0 in (none) iso.3.6.1.2.1.4.22.1.2.2.10.20.101.1 = Hex-STRING: 00 13 60 0D 3D 90 [root@localhost ~]# snmpwalk -c public -v1 localhost ipNetToMediaPhysAddress IP-MIB::ipNetToMediaPhysAddress.2.10.20.101.1 = STRING: 0:13:60:d:3d:90 OK, I may not have the 'disable reading all MIBs files' in the most efficient manner, but I think it did the job. But I also don't think its your ultimate solution, or even effective in your scenario. Fulko ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ 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