CPU Usage Monitoring
Overview
The system CPU usage is monitored. When the CPU usage exceeds the threshold for the CPU usage alarm or drops below the alarm clear threshold, a corresponding alarm is reported, and the alarm information is recorded in the monitoring log.
Configuration Description
/etc/sysmonitor/cpu is the configuration file of CPU usage monitoring.
The following shows the example configuration items in thisfile:
#Threshold for the CPU usage alarm. ALARM="90" #Threshold for the clear alarm. RESUME="80" #Monitoring period (s). MONITOR_PERIOD="60" #Statistics collection period (s) STAT_PERIOD="300"
Table 1 Configuration description describes the configuration items in the /etc/sysmonitor/cpu file.
Configuration Item |
Configuration description |
Mandatory or Not |
Default Value |
---|---|---|---|
ALARM |
Threshold for the CPU usage alarm, which is an integer greater than 0. |
No |
90 |
RESUME |
Threshold for the clear alarm, which is an integer greater than or equal to 0. |
No |
80 |
MONITOR_PERIOD |
Monitoring period. Unit: second. Value range: > 0. |
No |
60 |
STAT_PERIOD |
Statistics collection period. Unit: second. Value range: > 0. |
No |
300 |
- After the configuration file of CPU usage monitoring is modified, run the systemctl reload sysmonitor command so that the modifications can take effect in a new monitoring period.
- The value of ALARM must be greater than that of RESUME.
Error Log
If CPU usage alarms are reported, the following information is printed in /var/log/sysmonitor.log:
[2015-04-16:06:18:54]sysmonitor[27482]: CPU usage alarm: 91.3% [2015-04-16:06:24:16]sysmonitor[31896]: CPU usage resume: 70.1%