FAQ-Obtaining CPU Information Using SNMP

Publication Date:  2015-11-20 Views:  2154 Downloads:  0
Issue Description
The OID of CPU utilization is 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5; however, the query result includes many items. It is difficult to locate the device of which the CPU utilization is high.

OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67108867, Type=Integer, Value=0
OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67371013, Type=Integer, Value=0
OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67371017, Type=Integer, Value=10
......

A total of 78 items are displayed, which have different values.
Solution
1.  Scenario: Use the SNMPWALK to obtain device information, such as CPU utilization.

2.  Make the following preparations:

a.  Copy the SNMPWALK tool at http://www.snmpsoft.com/freetools/snmpwalk .htm to C:\windows\system32.

b. Read the MIB Reference of the corresponding version (for example, S9306 v200r003).

i. Log in to http://e.huawei.com.

ii. Choose Support > Product Support > Enterprise Networking > Switch > Campus Switch > S9300.

iii. Download the S9300&S9300E V200R003C00 MIB Reference at:

http://support.huawei.com/enterprise/docinforeader.action?contentId=DOC1000027267&idPath=7919710|9856733|7923144|16531

c. Configure SNMP on the switch.

[S9306]dis ver
VRP (R) software, Version 5.130 (S9300 V200R003C00SPC500)
[S9306]snmp-agent sys-info version all
[S9306]snmp-agent community read huawei123

3.  A switch, especially modular switch, has many entities. The CPU utilization is one of the entities. Each entity matches an index. Obtain the index first.

a. Enter cmd and run the following command:

snmpwalk -v:2c -c:huawei123 -r:192.168.108.100 -os:1.3.6.1.2.1.47.1.1.1.1 -op:1.3.6.1.2.1.47.1.1.1.2  >c:\entPhysicalTable.txt
-v: SNMP version, -c: community name, -r: target host, -os: start OID: 1.3.6.1.2.1.47.1.1.1.1, -op: end OID, >result stored at
b. Prefix 1.3.6.1.2.1.47.1.1.1.1, indicating entPhysicalTable.

4.  Obtain CPU information.

a. Enter cmd and run the following command:

snmpwalk -v:2c -c:huawei123 -r:192.168.108.100 -os:1.3.6.1.4.1.2011.5.25.31.1.1.1.1 -op:1.3.6.1.4.1.2011.5.25.31.1.1.1.2  >c:\hwEntityStateTable.txt

b. Prefix 1.3.6.1.4.1.2011.5.25.31.1.1.1.1, indicating hwEntityStateTable

This table provides the entity status, including management, operation, backup, alarm, CPU usage, usage, memory utilization, and threshold.

5. Query information based on indexes.

Example: Query the CPU utilization on the MPU.

[S9306]dis device
Chassis 1 (Master Switch)
S9306's Device status:
Slot  Sub Type         Online    Power      Register       Alarm      Primary
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1     -   LE0MG24CA    Present   PowerOn    Registered     Normal     NA
6     -   LE0DG24TFA00 Present   PowerOn    Registered     Normal     NA
7     -   LE0MSRUA     Present   PowerOn    Registered     Normal     Master
1   LE0MFSUA     Present   PowerOn    Registered     Normal     NA
PWR1  -   -            Present   PowerOn    Registered     Normal     NA
CMU1  -   LE0DCMUA0000 Present   PowerOn    Registered     Normal     Master
FAN1  -   -            Present   PowerOn    Registered     Normal     NA
FAN2  -   -            Present   PowerOn    Registered     Normal     NA

The SRU/MCU/MPU is in slot 7.

Find out MPU information in entPhysicalTable.txt.

OID=.1.3.6.1.2.1.47.1.1.1.1.7.68943881, Type=OctetString, Value=MPU Board 1/7 

Record the index. You will use this index to view CPU utilization.

Find out the following description based on the indexes:

OID=.1.3.6.1.2.1.47.1.1.1.1.2.68943881, Type=OctetString, Value=MPU Board                                             //Type
OID=.1.3.6.1.2.1.47.1.1.1.1.8.68943881, Type=OctetString, Value=LE02SRUA VER.D                                     //Firmware version
OID=.1.3.6.1.2.1.47.1.1.1.1.10.68943881, Type=OctetString, Value=Version 5.130 V200R003C00SPC500     //Software version
OID=.1.3.6.1.2.1.47.1.1.1.1.11.68943881, Type=OctetString, Value=020KQR*****                                          //Sequence number

Find out 1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5 (CPU utilization) in hwEntityStateTable.txt.

A total of 87 items related to CPU utilization are displayed.

OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67108867, Type=Integer, Value=0
OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67371013, Type=Integer, Value=0
OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.67371017, Type=Integer, Value=10


How to find out the CPU utilization on the MPU.

As mentioned previously, an entity matches an index (last eight digits). We have determined that the value for CPU utilization entity is 68943881.

Based on the CPU utilization and entity index, we find:

OID=.1.3.6.1.4.1.2011.5.25.31.1.1.1.1.5.68943881, Type=Integer, Value=9
Conclusion: The CPU utilization of MPU is 9%.
Similarly, the memory utilization of MPU is 22%.

END