Blogs

Are the Ping MIBs returned in decimal notation and ASCII?

By Erdem posted 02-01-2016 09:45

  

Question

Are the Ping MIBs returned in decimal notation and ASCII?

Answer

Yes, both decimal notation and ASCII are supported, which is the standard implementation in SNMP. All strings are ASCII encoded.

 

The following example displays the Ping MIB in hexadecimal notation:

 

pingCtlTargetAddress.2.69.72.9.116.99.112.115.97.109.112.108.101 = 0a fa 01 02

 

This translates to ASCII:

 

pingCtlTargetAddress."EH"."tcpsample" = 0a fa 01 02
2= length of the string
69=E
72=H
9=length of second string
116=t
99 =c
112=p
115=s
97=a
109=m
112 =p
108 =l
101 =e

 

As of Junos OS Release 9.6 and later, the Junos OS CLI returns ASCII values using the command show snmp mib get | get-next | walk ascii.

 

The following example shows the output with the ASCII option:

 

user@host> show snmp mib walk pingCtlTargetAddress ascii
pingCtlTargetAddress."EH"."httpgetsample" = http://www.yahoo.com
pingCtlTargetAddress."p1"."t2" = 74 c5 b3 06
pingCtlTargetAddress."p1"."t3" = 74 c5 b2 0c

 

The following example shows the output without the ASCII option:

 

user@host> show snmp mib walk pingCtlTargetAddress
pingCtlTargetAddress.2.69.72.13.104.116.116.112.103.101.116.115.97.109.112.108.101
= http://www.yahoo.com
pingCtlTargetAddress.2.112.49.2.116.50 = 74 c5 b3 06
pingCtlTargetAddress.2.112.49.2.116.51 = 74 c5 b2 0c

 

You can convert decimal and ASCII values using a decimal ASCII chart like the one at http://www.asciichart.com/.

 

For a list of supported standard and enterprise-specific MIBs, click SNMP MIBs and Traps Reference


#FAQ