Updated on 2024-04-19 GMT+08:00

Process Monitoring

Viewing Process Monitoring

Process monitoring is used to monitor active processes on a host. By default, the Agent collects CPU usage, memory usage, and the number of opened files of the active processes. If you have customized process monitoring, the number of processes containing keywords is also monitored.

The Agent collects process CPU usages every minute and displays the top 5 processes, ranked by the CPU usage over the last 24 hours.

To view the process monitoring information, install the Agent.

Querying the System Processes

After the Agent is installed, you can check system processes on Cloud Eye.

To query the number of processes, perform the following steps:

  1. Log in to the management console.
  2. Click Service List in the upper left corner, and select Cloud Eye.
  3. In the navigation pane on the left, choose Server Monitoring.
  4. On the Server Monitoring page, locate the target ECS and click View Metric to go to the OS Monitoring page.
  5. Select the Process Monitoring tab.
    In the System Processes area, the process information is displayed. Table 1 describes the metrics of system processes.
    Table 1 System process metrics

    Metric

    Description

    Value Range

    Collection (Linux)

    Collection (Windows)

    Running Processes

    Number of processes that are running

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Not supported

    Idle Processes

    Number of processes that are idle

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Not supported

    Zombie Processes

    Number of zombie processes

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Not supported

    Blocked Processes

    Number of processes that are blocked

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Not supported

    Sleeping Processes

    Number of processes that are sleeping

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Not supported

    Total Processes

    Total number of processes

    ≥ 0

    Monitored object: ECS or BMS

    You can obtain the state of each process by checking the Status value in the /proc/pid/status file, and then collect the total number of processes in each state.

    Monitored object: ECS or BMS

    Obtain the total number of processes by using the system process status support module psapi.dll.

Viewing the Data of Top CPU Processes

  • The Agent collects process CPU usages every minute and displays the top 5 processes, ranked by the CPU usage over the last 24 hours.
  • Run the top command to query the CPU usage and memory usage of a process.
  • Run the lsof or ls /proc/pid/fd |wc -l command to query the number of files opened by the current process. In the command, replace pid with the ID of the process to be queried.
    • If a process occupies multiple CPUs, the CPU usage may exceed 100% because the collection result is the total usage of multiple CPUs.
    • The top 5 processes are not fixed. The process list displays the top 5 processes that have entered the statistical period of 1 minute in the last 24 hours.
    • The CPU usage, memory usage, and number of opened files are collected only for the top 5 processes for which monitoring has been enabled in the last 24 hours. If such a process has been stopped, its data will not be displayed.
    • The time in the list indicates the time when a process was created.
    • If the system time on the client browser is different from that on the monitored ECS, the graph may have no metric data. In this case, synchronize the local time with the ECS time.

To query information about top 5 processes with the highest CPU usages

  1. Log in to the management console.
  2. Click Service List in the upper left corner, and select Cloud Eye.
  3. In the navigation pane on the left, choose Server Monitoring.
  4. On the Server Monitoring page, locate the target ECS and click View Metric to go to the OS Monitoring page.
  5. Select the Process Monitoring tab.
  6. In the Monitored Processes area, click in the upper right corner to view Top 5 Processes with Highest CPU Usage.
  7. In the displayed TOP 5 Processes with Highest CPU Usage window, enable process monitoring for target processes, and click OK.

    In the Monitored Processes area, the system selects processes in the Running state by default and displays CPU usage curves of those processes in 1h. The displayed data is raw data.

    You can also select the process to be displayed and view its CPU usage curve in 1h.

    You can click CPU Usage, Memory Usage, or Open Files above the graph to view the curves of different metrics of the currently displayed process. Table 2 lists Process Monitoring metrics.

    Figure 1 Process monitoring
    Table 2 Process Monitoring metrics

    Metric

    Description

    Value Range

    Collection (Linux)

    Collection (Windows)

    CPU Usage

    CPU consumed by a process

    pHashId (process name and process ID) is the value of md5.

    0-1 x Number of CPU cores

    Monitored object: ECS or BMS

    Check the metric value changes in file /proc/pid/stat.

    Monitored object: ECS or BMS

    Call the API GetProcessTimes to obtain the CPU usage of the process.

    Memory Usage

    Memory consumed by a process

    pHashId (process name and process ID) is the value of md5.

    0 to 1

    Monitored object: ECS or BMS

    Memory Usage = RSS*PAGESIZE/MemTotal

    RSS: Obtain its value by checking the second column of file /proc/pid/statm.

    PAGESIZE: Obtain its value by running the getconf PAGESIZE command.

    MemTotal: Obtain its value by checking file /proc/meminfo.

    Monitored object: ECS or BMS

    1. Invoke Windows API procGlobalMemoryStatusEx to obtain the total memory size.
    2. Invoke GetProcessMemoryInfo to obtain the used memory size.
    3. Use the used memory size to divide the total memory size to get the memory usage.

    Open Files

    The number of opened files consumed by the process

    pHashId (process name and process ID) is the value of md5.

    ≥ 0

    Monitored object: ECS or BMS

    You can run the ls -l /proc/pid/fd command to view the number.

    Not supported

  8. Hover your mouse over a graph. In the upper right corner, click to enlarge the graph for viewing detailed data.

    In the upper left corner, you can see six default monitoring periods: 1h, 3h, 12h, 1d, 7d, and 30d. To view historical monitoring data for any period during the last six months, customize the monitoring period by setting Select Range in the upper right corner.

    In the upper left corner of the graph, you can click Settings to configure the rollup method.

Adding Process Monitoring

Process monitoring is used to monitor active processes on a host. By default, the Agent collects CPU usage, memory usage, and the number of opened files of the active processes. Customized process monitoring can collect the number of key processes and obtain the status of key processes at any time.

Monitoring Specified Processes

Suppose that the following processes are running on a server:

/usr/bin/java
/usr/bin/ntpd
/telescope
/usr/bin/python

Three keywords are configured, and the collection results are as follows:

  • Key word: Java, number of processes: 1
  • Key word: telescope, number of processes: 1
  • Key word: /usr/bin, number of processes: 3

Add specified processes.

  1. Log in to the management console.
  2. Click Service List in the upper left corner, and select Cloud Eye.
  3. In the navigation pane on the left, choose Server Monitoring.
  4. On the Server Monitoring page, locate the target ECS and click View Metric to go to the OS Monitoring page.
  5. Select the Process Monitoring tab.
  6. On the Process Monitoring page, click Configure on the right of the Custom Processes area. On the Configure Monitoring for Custom Process page, configure the process name or keyword.
    Figure 2 Configure Monitoring for Custom Process

    You do not need to configure the Processes column. After you set the process name, the system will return the number of matched processes.

    After the configuration is complete, you can view the number of custom processes in the Custom Processes area on the Process Monitoring tab.

Enabling Alarm Notification for Custom Process Monitoring

You can configure alarm notifications. When the number of processes decreases or increases, Cloud Eye will notify you immediately.

To enable alarm notifications custom processes, perform the following steps:

  1. Log in to the management console.
  2. Click Service List in the upper left corner, and select Cloud Eye.
  3. In the navigation pane on the left, choose Server Monitoring.
  4. On the Server Monitoring page, locate the target ECS and click View Metric to go to the OS Monitoring page.
  5. Select the Process Monitoring tab.
  6. On the Process Monitoring page, click Configure on the right of the Custom Processes area.

    The Configure Monitoring for Custom Process box is displayed.

  7. Locate the desired process and click Create Alarm Rule.
  8. Configure alarm rule information by setting the metric in Alarm Policy to (Agent) Specifies Processes.

    Creating an Alarm Rule lists the parameters to be configured.