Configure agent health metrics collection

This guide shows you how to configure Google Cloud's Agent for SAP to collect the health metrics from the agent's daemon process on your Compute Engine instance or Bare Metal Solution server.

For information about this feature, see Agent health metrics collection.

Before you begin

Set IAM permissions

To enable Google Cloud's Agent for SAP collect the health metrics, you must ensure that the service account being used by your Compute Engine instance or Bare Metal Solution server includes the required IAM permissions.

To add these required permissions to your service account, follow these steps:

  1. In the Google Cloud console, go to the IAM page.

    Go to IAM

  2. Select your Google Cloud project.

  3. Identify the service account to which you want to add a role.

    • If the service account isn't already on the principals list, then it doesn't have any roles assigned to it. Click Grant Access and enter the email address of the service account.
    • If the service account is already on the principals list, then it has existing roles. Click the Edit button for the service account that you want to edit.
  4. Select the required role from the list of available roles:

    • Monitoring > Monitoring Metric Writer
  5. Click Save to apply the roles to the service account.

For a granular level of access, you can set the following IAM permissions to your own custom role:

  • Metrics Collection:
    • monitoring.timeSeries.create

For more information about how to create a custom role, see Create and manage custom roles.

Enable agent health metrics collection

To enable Google Cloud's Agent for SAP to collect the health metrics for its daemon process on your host, follow these steps:

  1. Establish an SSH connection with your host Compute Engine instance or Bare Metal Solution server.

  2. Enable the collection of the agent health metrics:

    Run command

    1. To enable the collection of the agent health metrics, run the following command:

      sudo /usr/bin/google_cloud_sap_agent configure -feature=agent_metrics -enable

    2. Optionally, you can modify the frequency at which the agent collects the CPU and memory usage of its daemon process and sends them to Cloud Monitoring. The default frequency is 60 seconds.

      To modify this frequency, run the following command:

      sudo /usr/bin/google_cloud_sap_agent configure -feature=agent_metrics -agent_metrics_frequency=FREQUENCY

      Replace FREQUENCY with the required value, in seconds. The frequency must not be less than 5 seconds.

    3. Optionally, you can modify the frequency at which the agent checks its operational health and sends that information to Cloud Monitoring. The default frequency is 60 seconds.

      To modify this frequency, run the following command. The frequency must not be less than 5 seconds.

      sudo /usr/bin/google_cloud_sap_agent configure -feature=agent_metrics -agent_health_frequency=FREQUENCY

    Edit configuration file

    As an alternative to running the agent's command, you can manually modify the agent's configuration as follows:

    1. Open the Backint configuration file:

      /etc/google-cloud-sap-agent/configuration.json
    2. In the collection_configuration section, include the following:

      "collect_agent_metrics": true
    3. Optionally, you can modify the frequency at which the agent collects the CPU and memory usage of its daemon process and sends them to Cloud Monitoring. The default frequency is 60 seconds.

      To modify this frequency, include the following in the collection_configuration section.

      "agent_metrics_frequency": FREQUENCY

      Replace FREQUENCY with the required value, in seconds. The frequency must not be less than 5 seconds.

    4. Optionally, you can modify the frequency at which the agent checks its operational health and sends that information to Cloud Monitoring. The default frequency is 60 seconds.

      To modify this frequency, include the following in the collection_configuration section. The frequency must not be less than 5 seconds.

      "agent_health_frequency": FREQUENCY
    5. Save the configuration file.

    6. Restart the agent for the new settings to take effect:

      sudo systemctl restart google-cloud-sap-agent

Example configuration files

Compute Engine instance

The following example is a completed configuration file of Google Cloud's Agent for SAP running on a Compute Engine instance, where the collection of the agent health metrics is enabled:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": false,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false,
    "collect_agent_metrics": true,
    "agent_metrics_frequency": 60,
    "agent_health_frequency": 60
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "instance-1",
    "image": "rhel-8"
  },
  "discovery_configuration": {
    "enable_discovery": true,
    "enable_workload_discovery": true
  },
  "hana_monitoring_configuration": {
    "enabled": false
  }
}

Bare Metal Solution server

The following example is a completed configuration file of Google Cloud's Agent for SAP running on a Bare Metal Solution server, where the collection of the agent health metrics is enabled:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": true,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false,
    "collect_agent_metrics": true,
    "agent_metrics_frequency": 60,
    "agent_health_frequency": 60
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "bms-machine-1"
"region": "us-central1", "image": "rhel-8" }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": false } }

Configuration parameters

The following table explains the configuration parameters of Google Cloud's Agent for SAP that are specific to the collection of the agent health metrics:

Parameters
collection_configuration.collect_agent_metrics

Boolean

Optional. Specify true to let the agent collect the following information and send them to Cloud Monitoring:

  • CPU and memory usage by the agent's daemon process on your host.
  • The operational health of the agent's daemon process on your host.

The default value is false.

collection_configuration.agent_metrics_frequency

Int

Optional. Specify the frequency at which the agent collects the CPU and memory usage of its daemon process on the host and sends them to Cloud Monitoring. This information is captured by the sap/agent/cpu/utilization and sap/agent/memory/utilization metrics. The default value is 60 seconds. The frequency must not be less than 5 seconds.

collection_configuration.agent_health_frequency

Int

Optional. Specify the frequency at which the agent which the agent checks its operational health and sends that information to Cloud Monitoring. This information is captured by the sap/agent/health metric. The default value is 60 seconds. The frequency must not be less than 5 seconds.