Introduction

The CPU is a core component of the device. When the system fails or suffers network attacks, it will take up a lot of CPU resources. This degrades system performance and results in data processing delays which in turn can potentially lead to high packet loss. During data processing, if the device can generate an SNMP Trap alarm when high CPU usage occurs, you can effectively monitor CPU usage and optimize system performance to maintain efficient data forwarding and network topology stability.


New PICA8 Private MIB Information

OID

Object Name

Description

1.3.6.1.4.1.35098.1.14.1.0

oidCpuThresholdStatus

This object is in configuration information node.

The value of this object identifies whether the function of monitoring the switch CPU usage is enabled or disabled. The value could be 0 or 1.

0: disable.

1: enable.

1.3.6.1.4.1.35098.1.14.2.0

oidCpuHighThresholdValue

This object is in configuration information node.

The value of this object identifies the overload threshold for CPU usage monitoring.

The value is an integer that ranges from 1 to 100, indicating 1% to 100%.

The default value is 80.

1.3.6.1.4.1.35098.1.14.3.0

oidCpuLowThresholdValue

This object is in configuration information node.

The value of this object identifies the low threshold for CPU usage monitoring.

The value is an integer that ranges from 1 to 100, indicating 1% to 100%.

The default value is 20.

1.3.6.1.4.1.35098.1.14.4.0

oidCpuThresholdPeriod

This object is in configuration information node.

The value of this object identifies the time duration when the CPU usage continues to exceed the overload threshold or fall below the low threshold.

The value is an integer, in seconds, that ranges from 5 to 4294967295.

The default value is 300s.

1.3.6.1.4.1.35098.21.4.1

oidCpuHighThreshold 

This object is used in the syslog and

SNMP Trap message, indicating the CPU usage reaches the overload threshold for a continuous period of time, the system sends an SNMP Trap alarm message.

1.3.6.1.4.1.35098.21.4.2

oidCpuLowThreshold  

This object is used in the syslog and

SNMP Trap message, indicating the CPU usage falls below the low threshold a continuous period of time, the system sends an SNMP Trap alarm message.

Configuring CPU Usage Alarm Threshold

Step1         Enable the function of monitoring the switch CPU usage.

                   set protocols snmp trap-group event cpu-threshold enable <true | false>

Step2         Set the overload threshold and low threshold for CPU usage monitoring to send SNMP Trap messages.

                   set protocols snmp trap-group event cpu-threshold high <high-value>

                   set protocols snmp trap-group event cpu-threshold low <low-value>

Step3         Configure the time duration for which the CPU usage continues to exceed the overload threshold or fall below the low threshold.

                   set protocols snmp trap-group event cpu-threshold interval <interval>

The system samples CPU usage one time every 5 seconds, if the CPU usage is out of the threshold range for this interval time, a SNMP trap message will be sent. But once CPU usage falls back into the threshold range and the duration time is not up, the duration time then will be recalculated and the trap message won’t be sent.

Configuration Example

Procedure

Step1         Configure the target host with IP address 10.10.50.16 for receiving SNMP traps.

admin@Xorplus#set protocols snmp community public
admin@Xorplus#set protocols snmp trap-group targets 10.10.50.16 security-name public

Step2         Enable the function of monitoring the switch CPU usage.

admin@Xorplus# set protocols snmp trap-group event cpu-threshold enable true

Step3         Set the overload threshold and low threshold for CPU usage monitoring to send SNMP Trap messages.

admin@Xorplus# set protocols snmp trap-group event cpu-threshold high 80
admin@Xorplus# set protocols snmp trap-group event cpu-threshold low 20

Step4         Configure the time duration for which the CPU usage continues to exceed the overload threshold or fall below the low threshold, and an SNMP Trap message will be sent.

admin@Xorplus# set protocols snmp trap-group event cpu-threshold interval 300

Step5         Enable SNMP traceoptions for checking the SNMP syslog.

admin@Xorplus# set protocols snmp traceoptions flag all disable false

Step6         Commit the configuration.

admin@Xorplus# commit

Verify the Configuration

          Syslog message when the CPU usage monitoring continuously exceeds the overload threshold:

          2018-05-01 09:27:44.86 Xorplus local0.info : [SNMP]Trap: send v2 trap, community name public, oid: 1.3.6.1.4.1.35098.21.4.1, to:10.10.50.16/162

         Syslog message when the CPU usage monitoring continuously stays below the low threshold:

         2001-04-01 06:50:44.86 Xorplus local0.info : [SNMP]Trap: send v2 trap, community name public, oid: 1.3.6.1.4.1.35098.21.4.2, to:10.10.50.16/162