There have been some instances where customers have asked about how to find out what what network interfaces a machine has by using SNMP. The main reason they want to use SNMP is to achieve the requirement of creating an inventory report and for monitoring remote network devices including Windows systems, routers, and switches with an SNMP Manager (like Microsoft Operations Manager 2005).
The following article explains how to query the network interfaces of a local or remote Windows machine using SNMP
To query a value we need to use an OID (Object Identifier).
The ifDescr counter’s OID is .1.3.6.1.2.1.2.2.1.2
The above mentioned OID may be used to query the list of network interfaces via SNMP.
OID (.1.3.6.1.2.1.2.2.1.2) description:
ifDescr OBJECT-TYPE SYNTAX DisplayString (SIZE (0..255)) ACCESS read-only STATUS mandatory DESCRIPTION "A textual string containing information about the interface. This string should include the name of the manufacturer, the product name and the version of the hardware interface."
Command to be used
"snmputil walk hostname communityname .1.3.6.1.2.1.2.2.1.2"
Example:
Note:
The same OID can be used query from any SNMP Manager or SNMPUtil
How to convert the ASCII output to plain text
- The ifDescr counter (OID - .1.3.6.1.2.1.2.2.1.2) will be appended by .1, .2, .3 and so on, based on the number of adapters that are present
- Refer the output displayed above. The output will be a string of hexadecimal values which will be in ASCII format. The output would be like <0x53><0x6f>........
- In order to make it readable (converting from ASCII to human readable form), we need an ASCII (Hex to text) converter utility, which may be downloaded from the Internet. Search for such a utility with keywords like “ASCII (Hex to Text) Converter” or “ASCII converter”
If the ASCII converter you use accepts only “:” or “;” as separators, the format of the current hex values (<0x53><0x6f>) need to be changed with ":" or ":" as a separator (53:6f) manually to work properly with the ASCII converter utility.
Example
<0x53><0x6f><0x66><0x74><0x77><0x61><0x72><0x65><0x20><0x4c><0x6f><0x6f><0x70> <0x62><0x61><0x63><0x6b><0x20><0x49><0x6e><0x74><0x65><0x72><0x66><0x61><0x63> <0x65><0x20><0x31><0x00>
which may need to be manually converted to before entering it into your ASCII converter as discussed above to something like this:
53:6f:66:74:77:61:72:65:20:4c:6f:6f:70:62:61:63:6b:20:49:6e:74:65:72:66:61:63: 65:20:31:00
Paste the value in the ASCII converter and convert it to plain text. The output (in readable format) for the above example would be:
Software Loopback Interface 1
Sample output from a Windows system which has both a physical NIC and a wireless NIC
Variable = interfaces.ifTable.ifEntry.ifDescr.1 Value = String <0x53><0x6f><0x66><0x74><0x77><0x61><0x72><0x65><0x20><0x4c><0x6f><0x6f><0x70> <0x62><0x61><0x63><0x6b><0x20><0x49><0x6e><0x74><0x65><0x72><0x66><0x61><0x63> <0x65><0x20><0x31><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.2 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x53><0x53><0x54><0x50><0x29><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.3 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x49><0x4b><0x45><0x76><0x32><0x29><0x00> Variable = interfaces.ifTable.ifEntry.ifDescr.4 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x4c><0x32><0x54><0x50><0x29><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.3 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x49><0x4b><0x45><0x76><0x32><0x29><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.4 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x4c><0x32><0x54><0x50><0x29><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.5 Value = String <0x57><0x41><0x4e><0x20><0x4d><0x69><0x6e><0x69><0x70><0x6f> <0x72><0x74><0x20><0x28><0x50><0x50><0x54><0x50><0x29><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.11 Value = String <0x4d><0x69><0x63><0x72><0x6f><0x73><0x6f><0x66><0x74><0x20> <0x36><0x74><0x6f><0x34><0x20><0x41><0x64><0x61><0x70><0x74><0x65><0x72><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.12 Value = String <0x4d><0x69><0x63><0x72><0x6f><0x73><0x6f><0x66><0x74><0x20><0x54><0x65><0x72> <0x65><0x64><0x6f><0x20><0x54><0x75><0x6e><0x6e><0x65><0x6c><0x69><0x6e><0x67> <0x20><0x41><0x64><0x61><0x70><0x74><0x65><0x72><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.13 Value = String <0x49><0x6e><0x74><0x65><0x6c><0x28><0x52><0x29><0x20><0x38><0x32><0x35><0x36> <0x37><0x4c><0x4d><0x20><0x47><0x69><0x67><0x61><0x62><0x69><0x74><0x20><0x4e> <0x65><0x74><0x77><0x6f><0x72><0x6b><0x20><0x43><0x6f><0x6e><0x6e><0x65><0x63> <0x74><0x69><0x6f><0x6e><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.14 Value = String <0x4d><0x69><0x63><0x72><0x6f><0x73><0x6f><0x66><0x74><0x20> <0x49><0x53><0x41><0x54><0x41><0x50><0x20><0x41><0x64><0x61><0x70><0x74><0x65> <0x72><0x00>
Variable = interfaces.ifTable.ifEntry.ifDescr.15 Value = String <0x49><0x6e><0x74><0x65><0x6c><0x28><0x52><0x29><0x20><0x57><0x69><0x46><0x69> <0x20><0x4c><0x69><0x6e><0x6b><0x20><0x35><0x33><0x30><0x30><0x20><0x41><0x47> <0x4e><0x00>
After conversion
Variable = interfaces.ifTable.ifEntry.ifDescr.1 53:6f:66:74:77:61:72:65:20:4c:6f:6f:70:62:61:63:6b:20:49:6e:74:65:72:66:61:63: 65:20:31:00 Software Loopback Interface 1
Variable = interfaces.ifTable.ifEntry.ifDescr.1
================================================
Variable = interfaces.ifTable.ifEntry.ifDescr.2 57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:53:53:54:50:29:00 WAN Miniport (SSTP)
Variable = interfaces.ifTable.ifEntry.ifDescr.2
57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:53:53:54:50:29:00
WAN Miniport (SSTP)
Variable = interfaces.ifTable.ifEntry.ifDescr.3 57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:49:4b:45:76:32:29:00 WAN Miniport (IKEv2)
Variable = interfaces.ifTable.ifEntry.ifDescr.3
57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:49:4b:45:76:32:29:00
WAN Miniport (IKEv2)
Variable = interfaces.ifTable.ifEntry.ifDescr.4 57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:4c:32:54:50:29:00 WAN Miniport (L2TP)
Variable = interfaces.ifTable.ifEntry.ifDescr.4
57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:4c:32:54:50:29:00
WAN Miniport (L2TP)
Variable = interfaces.ifTable.ifEntry.ifDescr.5 57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:50:50:54:50:29:00 WAN Miniport (PPTP)
Variable = interfaces.ifTable.ifEntry.ifDescr.5
57:41:4e:20:4d:69:6e:69:70:6f:72:74:20:28:50:50:54:50:29:00
WAN Miniport (PPTP)
Variable = interfaces.ifTable.ifEntry.ifDescr.11 4d:69:63:72:6f:73:6f:66:74:20:36:74:6f:34:20:41:64:61:70:74:65:72:00 Microsoft 6to4 Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.11
4d:69:63:72:6f:73:6f:66:74:20:36:74:6f:34:20:41:64:61:70:74:65:72:00
Microsoft 6to4 Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.12 4d:69:63:72:6f:73:6f:66:74:20:54:65:72:65:64:6f:20:54:75:6e:6e:65:6c:69:6e:67: 20:41:64:61:70:74:65:72:00 Microsoft Teredo Tunneling Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.12
4d:69:63:72:6f:73:6f:66:74:20:54:65:72:65:64:6f:20:54:75:6e:6e:65:6c:69:6e:67: 20:41:64:61:70:74:65:72:00
Microsoft Teredo Tunneling Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.13 49:6e:74:65:6c:28:52:29:20:38:32:35:36:37:4c:4d:20:47:69:67:61:62:69:74:20:4e: 65:74:77:6f:72:6b:20:43:6f:6e:6e:65:63:74:69:6f:6e:00 Intel(R) 82567LM Gigabit Network Connection
Variable = interfaces.ifTable.ifEntry.ifDescr.13
49:6e:74:65:6c:28:52:29:20:38:32:35:36:37:4c:4d:20:47:69:67:61:62:69:74:20:4e: 65:74:77:6f:72:6b:20:43:6f:6e:6e:65:63:74:69:6f:6e:00
Intel(R) 82567LM Gigabit Network Connection
Variable = interfaces.ifTable.ifEntry.ifDescr.14 4d:69:63:72:6f:73:6f:66:74:20:49:53:41:54:41:50:20:41:64:61:70:74:65:72:00 Microsoft ISATAP Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.14
4d:69:63:72:6f:73:6f:66:74:20:49:53:41:54:41:50:20:41:64:61:70:74:65:72:00
Microsoft ISATAP Adapter
Variable = interfaces.ifTable.ifEntry.ifDescr.15 49:6e:74:65:6c:28:52:29:20:57:69:46:69:20:4c:69:6e:6b:20:35:33:30:30:20:41:47:4e: 00 Intel(R) WiFi Link 5300 AGN
Variable = interfaces.ifTable.ifEntry.ifDescr.15
49:6e:74:65:6c:28:52:29:20:57:69:46:69:20:4c:69:6e:6b:20:35:33:30:30:20:41:47:4e: 00
Intel(R) WiFi Link 5300 AGN
More information:
SNMP terms
http://msdn.microsoft.com/en-us/library/ms894635.aspx
Management Information Base
http://msdn.microsoft.com/en-us/library/ms894545.aspx
- Prathabacimman Mohan