By default, process monitoring allows you to collect information about active processes, including the CPU usage, memory usage, and number of opened files during a recent time period. If you add a process keyword, you can collect the number of processes that match the keyword.

View the resource consumption of active processes

  • The CloudMonitor agent collects the top five processes with the most CPU usage every minute, and records the CPU usage, memory usage, and number of files opened by these processes.
  • For more information about how the CloudMonitor agent collects the CPU usage and memory usage of processes, see the top command in the Linux operating system.
  • For more information about how the CloudMonitor agent collects the number of files opened by processes, see the lsof command in the Linux operating system.
Note
  • If your process occupies multiple CPU cores, the collected CPU usage may exceed 100% because the CloudMonitor agent collects the total CPU usage of the process on all the occupied CPU cores.
  • If the top five processes are not fixed during the time period specified in your query, the process list contains all the processes that have ranked top five over the specified time period. The time in the list indicates when the processes last ranked top five.
  • The CloudMonitor agent only collects the CPU usage, memory usage, and number of opened files for a process when it enters the top five. Therefore, if a process has not stayed in top five all over the time period specified in your query, its monitoring data appears as dispersed data points in the monitoring charts. The density of the data points indicates the activity level of the process on the host.
    • As shown in the following figure, the data points for the wrapper process are sparse and discontinuous in the monitoring charts. This is because the wrapper process did not continuously rank top five with the most CPU usage during the specified time period.
    • The data points in the monitoring charts are dense and continuous, indicating that the java process continuously ranks top five with the most CPU usage.

Monitor the number of specified processes

You can monitor the number and status of key processes by adding process keywords.

  • Add a process keyword
    Assume that the following processes run on your host:
    • /usr/bin/java -Xmx2300m -Xms2300m org.apache.catalina.startup.Bootstrap
    • /usr/bin/ruby
    • nginx -c /ect/nginx/nginx.conf
    You can add the following process keywords and obtain the monitoring results accordingly:
    • ruby: One process matches this keyword with its name. Therefore, the number of the processes that match this keyword is 1.
    • nginx: One process matches this keyword with its name and parameter. Therefore, the number of the processes that match this keyword is 1.
    • /usr/bin: Two processes match this keyword with their paths. Therefore, the number of the processes that match this keyword is 2.
    • apache.catalina: One process matches this keyword with its parameter. Therefore, the number of the processes that match this keyword is 1.
    • nginx.conf: One process matches this keyword with its parameter. Therefore, the number of the processes that match this keyword is 1.
    • -c: One process matches this keyword with its parameter. Therefore, the number of the processes that match this keyword is 1.

    Procedure

    1. Log on to the CloudMonitor console.
    2. In the left-side navigation pane, click Host Monitoring.
    3. On the Instances tab of the Host Monitoring page, find the target host and click its name or click Monitoring Charts in the Actions column.
    4. On the page that appears, click the Process Monitoring tab.
    5. To add a process keyword, click Add Process in the Number of Processes(Count) chart.
    6. In the Add Process Monitor dialog box, enter a process name or a keyword and click Add.
  • Delete a process keyword
    1. Log on to the CloudMonitor console.
    2. In the left-side navigation pane, click Host Monitoring.
    3. On the Instances tab of the Host Monitoring page, find the target host and click its name or click Monitoring Charts in the Actions column.
    4. On the page that appears, click the Process Monitoring tab.
    5. Click Add Process in the Number of Processes(Count) chart.
    6. In the Add Process Monitor dialog box, find the target process keyword and click Delete in the Actions column.
  • Set alert rules

    After you add process keywords, you can set alert rules for sending alert notifications when the number of processes that match the process keywords changes.

    1. Log on to the CloudMonitor console.
    2. In the left-side navigation pane, click Host Monitoring.
    3. On the Instances tab of the Host Monitoring page, find the target host and click Alarm Rules in the Actions column.
    4. On the Alarm Rules tab of the Host Monitoring page, click Create Alarm Rule.
    5. In the Set Alarm Rules section of the Create Alarm Rule page, select Host Process Number from the Rule Description drop-down list and specify the condition that triggers the alert rule. If multiple processes run on the host and the number of processes that matches each process keyword varies, you can click Add Alarm Rule to set multiple alert rules at a time.