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 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:
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
FREQUENCY
with 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_configuration
section, 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_configuration
section."agent_metrics_frequency": FREQUENCY
Replace
FREQUENCY
with 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_configuration
section. 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:
Parameters | |
---|---|
collection_configuration.collect_agent_metrics |
Optional. Specify
The default value is |
collection_configuration.agent_metrics_frequency |
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 |
collection_configuration.agent_health_frequency |
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 |