HEX- String instead of Octet - String - incase of inetAddress

"Bek, Anshul" <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
Hi ,

Below is the output of snmpwalk:

[root@cucm-12-5-1-pub<mailto:root@cucm-12-5-1-pub> ~]# snmpwalk -c test -v2c localhost 1.3.6.1.4.1.9.9.156.1.1.2
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.2.1 = STRING: "10.63.37.50"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.2.2 = STRING: "10.63.37.51"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.3.1 = STRING: "mycoll-12-5-1-pub"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.3.2 = STRING: "mycoll-12-5-1-sub"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.4.1 = STRING: "12.5.1.11900-146"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.4.2 = STRING: "UNKNOWN"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.5.1 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.5.2 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.6.1 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.6.2 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.7.1 = STRING: "
?%2"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.7.2 = STRING: "
?%3"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.8.1 = STRING: "MYCOLL50"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.8.2 = STRING: "MYCOLL50"
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.9.1 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.9.2 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.156.1.1.2.1.10.1 = ""


For 9.9.156.1.1.2.1.7.1 and 9.9.156.1.1.2.1.7.2, its basically an InetAddress.

I have 2 queries:


  1.  Is there any way to get only these 2 InetAddress as Hex-string. I can see that  in sprint_realloc_octet_string() in snmplib/mib.c involves in sprinting OCTET STRINGS for snmpgets and walks. Is there any value to check ? Also  hints, enums and units passed in NULL.
  2.  Why is the IP display in this manner ie. each octet in ascii . Is it by default ?

Note:- I don't want to use -Ox option as this will display all the strings value in Hex.

Regards,
Anshul Bek

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
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.