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

Prerequisites

The CloudMonitor agent is installed. For more information, see Install and uninstall the CloudMonitor agent for C++.

Background information

  • The CloudMonitor agent collects the top five processes with the most CPU consumption every minute. This agent also records CPU utilization, memory usage, and the number of opened files in these processes.
    • CPU utilization and memory usage of a process

      You can check the output of the top command in the Linux operating system to understand the two metrics.

    • Number of opened files in a process

      You can check the output of the lsof command in the Linux operating system to understand this metric.

  • If your process occupies multiple CPU cores, the collected CPU utilization may exceed 100%. This is because the CloudMonitor agent collects the total CPU utilization of the process on all the occupied CPU cores.
  • If the top five processes vary during the time period specified in your query, the process list displays all the processes that have ranked top five over the specified time period. The time displayed in the list indicates when the processes last ranked top five.
  • The CloudMonitor agent collects only CPU utilization, memory usage, and the number of opened files for a process when the process ranks top five. If a process has not stayed in the top five within the time period specified in your query, its monitoring data is displayed as dispersed data points in the monitoring charts. The density of the data points indicates the activity level of the process on the host. The following figures show some examples.
    • 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 consumption during the specified time period.
    • The data points for the java process are dense and continuous in the monitoring charts. This is because the java process continuously ranked top five with the most CPU consumption during the specified time period.

Add processes that match a process keyword

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

Assume that the following processes run on your host:
  • /usr/bin/java -Xmx2300m -Xms2300m org.apache.catalina.startup.Bootstrap
  • /usr/bin/ruby
  • nginx -c /etc/nginx/nginx.conf
You can add the following process keywords and obtain the following monitoring results:
  • ruby: One process matches this keyword by name. Therefore, the number of processes that match this keyword is 1.
  • nginx: One process matches this keyword by name and parameter. Therefore, the number of processes that match this keyword is 1.
  • /usr/bin: Two processes match this keyword by path. Therefore, the number of processes that match this keyword is 2.
  • apache.catalina: One process matches this keyword by parameter. Therefore, the number of processes that match this keyword is 1.
  • nginx.conf: One process matches this keyword by parameter. Therefore, the number of processes that match this keyword is 1.
  • -c: One process matches this keyword by parameter. Therefore, the number of processes that match this keyword is 1.
  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, click the instance name of the host or click Monitoring Charts in the Actions column.
  4. On the Instance Info page, click the Process Monitoring tab.
  5. On the Process Monitoring tab, click Add Process in the upper-right corner.
  6. In the Add Process Monitor dialog box, enter a process keyword and click Add.
  7. Click Close.

Remove the processes that match 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, click the instance name of the host or click Monitoring Charts in the Actions column.
  4. On the Instance Info page, click the Process Monitoring tab.
  5. On the Process Monitoring tab, click Add Process in the upper-right corner.
  6. In the Add Process Monitor dialog box, click Delete in the Actions column.
  7. Click Close.

Configure an alert rule for specific processes

After you add processes that match a specific process keyword to CloudMonitor, you can configure an alert rule for the processes. You can then receive alert notifications if the number of processes that match the process keyword 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 host on which the process runs and click Alert Rules in the Actions column.
  4. On the Alert Rules tab, click Create Alert Rule.
  5. On the Create Alert Rule page, select process.number from the Rule Description drop-down list. Set other parameters of the alert rule based on your business requirements.
    • If multiple processes run on the host and the number of processes that match each process keyword varies, you can click Add Alert Rule to configure multiple alert rules at a time.
    • For more information about how to set required parameters for an alert rule, see Create a threshold-triggered alert rule.
  6. Click Confirm.