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 VM 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.
Set IAM roles
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 VM instance or Bare Metal Solution server includes the following roles:
To add these required roles to your service account, follow these steps:
In the Google Cloud console, go to the IAM page.
Select your Google Cloud project.
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.
Select the required role from the list of available roles:
- Compute Engine > Compute Viewer
- Monitoring > Monitoring Metric Writer
Click Save to apply the roles to the service account.
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 VM 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 VM instance
The following example is a completed configuration file of Google Cloud's Agent for SAP running on a Compute Engine VM 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": "vm-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 |
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 |