Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Extra Characters with SNMP CDP

I am trying to grab phone IP address information from a 4506 switch via the CISCO-CDP-MIB. A number of the phones are returning extra "garbage" characters along with the data. Any idea what is going on?

70 lfarm15 > snmpwalk -v 2c -c PUBLIC ca09-c4506-1 .1.3.6.1.4.1.9.9.23.1.2.1.1.4

enterprises.9.9.23.1.2.1.1.4.2.59 = Hex: 0A 2C 07 12

enterprises.9.9.23.1.2.1.1.4.3.60 = Hex: 0A 2C 07 12

enterprises.9.9.23.1.2.1.1.4.4.56 = Hex: 0A 2C 07 19

enterprises.9.9.23.1.2.1.1.4.102.68 = ".,.3" Hex: 0A 2C 0D 33

enterprises.9.9.23.1.2.1.1.4.103.62 = ".,.#" Hex: 0A 2C 0D 23

enterprises.9.9.23.1.2.1.1.4.106.54 = ".,.\"" Hex: 0A 2C 0D 22

enterprises.9.9.23.1.2.1.1.4.114.66 = ".,.Y" Hex: 0A 2C 0D 59

Any assistance would be appreciated.

Thanks

Brad

2 REPLIES
Cisco Employee

Re: Extra Characters with SNMP CDP

Looks like this could be a switch code bug, but I would run a packet capture to make sure the raw snmp packets are sending the same garbage characters and that is not just the snmp tool interpreting something incorrectly.

You might want to open a TAC service request to confirm if this is a new or existing bug. I did a quick search and didn't see anything.

New Member

Re: Extra Characters with SNMP CDP

So it turns out that some of the characters that are being sent but the switch are "packed". The perl Net::SNMP module was not handling these correctly.

From the command line snmpwalk shows both the packet characters and the unpacked characters:

enterprises.9.9.23.1.2.1.1.4.2.59 = Hex: 0A 2C 07 12

enterprises.9.9.23.1.2.1.1.4.3.60 = Hex: 0A 2C 07 12

enterprises.9.9.23.1.2.1.1.4.4.56 = Hex: 0A 2C 07 19

enterprises.9.9.23.1.2.1.1.4.101.71 = ".,.a" Hex: 0A 2C 0D 61

enterprises.9.9.23.1.2.1.1.4.102.68 = ".,.3" Hex: 0A 2C 0D 33

enterprises.9.9.23.1.2.1.1.4.103.62 = ".,.#" Hex: 0A 2C 0D 23

So remedy this in the script I called unpack('H*',$_) on the packet variables (note: I check to see if they had "x" in them to determine if they were packed)

Brad

154
Views
0
Helpful
2
Replies
CreatePlease to create content