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

Required roles

To ensure that the service account has the necessary permissions to let Google Cloud's Agent for SAP collect Agent Health metrics, ask your administrator to grant the service account the following IAM roles on your project:

For more information about granting roles, see Manage access to projects, folders, and organizations.

These predefined roles contain the permissions required to let Google Cloud's Agent for SAP collect Agent Health metrics. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to let Google Cloud's Agent for SAP collect Agent Health metrics:

  • To collect the Agent Health metrics from the host Compute Engine instance and write them to Cloud Monitoring: monitoring.timeSeries.create

Your administrator might also be able to give the service account these permissions with custom roles or other predefined 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
  },
  "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.