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
- Validate your installation of Google Cloud's Agent for SAP. For instructions, see the installation guide for your scenario .
- If you have installed the agent on a Bare Metal Solution server, then make sure that you have completed the required prerequisites and set up a service account. For instructions, see Configure Google Cloud's Agent for SAP on Linux .
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:
- Monitoring Metric Writer (
roles/monitoring.metricWriter) : to write the collected metrics to Cloud Monitoring.
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 permissionssection:
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:
-
Establish an SSH connection with your host Compute Engine instance or Bare Metal Solution server.
-
Enable the collection of the agent health metrics:
Run command
-
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
-
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
FREQUENCYwith the required value, in seconds. The frequency must not be less than 5 seconds. -
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:
-
Open the Backint configuration file:
/etc/google-cloud-sap-agent/configuration.json
-
In the
collection_configurationsection, include the following:"collect_agent_metrics": true
-
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_configurationsection."agent_metrics_frequency": FREQUENCYReplace
FREQUENCYwith the required value, in seconds. The frequency must not be less than 5 seconds. -
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_configurationsection. The frequency must not be less than 5 seconds."agent_health_frequency": FREQUENCY -
Save the configuration file.
-
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:
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.

