Version 2: Google Cloud's Agent for SAP operations guide

This guide covers operational considerations and procedures for running version 2 of Google Cloud's Agent for SAP on Compute Engine VM instances and Bare Metal Solution servers.

Understand the agent lifecycle

When managing the operations of Google Cloud's Agent for SAP, it's helpful to understand what the agent does. In general, here's how it works:

  • You must install Google Cloud's Agent for SAP on each Compute Engine VM instance or Bare Metal Solution server that hosts SAP systems. The agent runs as a Linux service or a Windows service.
  • On Compute Engine VM instances, the agent combines monitoring data from Monitoring and the Compute Engine APIs.
  • On Bare Metal Solution servers, for collection of only SAP Host Agent metrics, the agent does not access the Google Cloud APIs.
  • The SAP Host Agent polls Google Cloud's Agent for SAP for its cached data, over HTTP. It aggregates the SAP Host Agent metrics, reports them, and stores them in the SAP NetWeaver database.
  • SAP's transaction ST06 or the saposcol command line interface displays the aggregated SAP Host Agent metrics.
  • You can view the SAP Host Agent metrics from Google Cloud's Agent for SAP by running a command in a terminal window.

Verify that the agent is running

After installing the agent or restarting the agent, you can verify that the agent is running as expected.

To check whether the agent is running, follow these steps:

Linux

  1. Establish an SSH connection with your Bare Metal Solution server or VM instance.

  2. Run the following command:

    systemctl status google-cloud-sap-agent

    If the agent is functioning properly, then the output contains active (running). For example:

    google-cloud-sap-agent.service - Google Cloud Agent for SAP
    Loaded: loaded (/usr/lib/systemd/system/google-cloud-sap-agent.service; enabled; vendor preset: disabled)
    Active:  active (running)  since Fri 2022-12-02 07:21:42 UTC; 4 days ago
    Main PID: 1337673 (google-cloud-sa)
    Tasks: 9 (limit: 100427)
    Memory: 22.4 M (max: 1.0G limit: 1.0G)
    CGroup: /system.slice/google-cloud-sap-agent.service
           └─1337673 /usr/bin/google-cloud-sap-agent
    

Windows

  1. Use RDP to connect to the VM instance.

  2. As an administrator, run the following command from PowerShell:

    $(Get-Service -Name 'google-cloud-sap-agent' -ErrorAction Ignore).Status
    If the agent is running, then the status shows Running.

If Google Cloud's Agent for SAP isn't running, then restart the agent.

Check the version of the agent

After installing or restarting Google Cloud's Agent for SAP, you can check the version of the agent.

To check the version of your agent, complete the following steps:

Linux

For RHEL, follow these steps:

  1. Use SSH to connect to the host machine.
  2. Run the following command:
    yum info google-cloud-sap-agent

For SLES, follow these steps:

  1. Use SSH to connect to the host machine.
  2. Run the following command:
    zypper info google-cloud-sap-agent

Windows

  1. Use RDP to connect to the host machine.
  2. As an administrator, run the following command from PowerShell:
    googet installed google-cloud-sap-agent

Verify that SAP Host Agent is receiving metrics

To verify that the infrastructure metrics are collected by Google Cloud's Agent for SAP and sent correctly to the SAP Host Agent, follow these steps:

  1. In your SAP system, enter transaction ST06.
  2. In the overview pane, check the availability and content of the following fields for the correct end-to-end setup of the SAP and Google monitoring infrastructure:

    • Cloud Provider: Google Cloud Platform
    • Enhanced Monitoring Access: TRUE
    • Enhanced Monitoring Details: ACTIVE

View the SAP Host Agent metrics

After installing or updating the configuration of Google Cloud's Agent for SAP, you can view the collected SAP Host Agent metrics.

To view the SAP Host Agent metrics collected by Google Cloud's Agent for SAP, follow these steps:

Linux

  1. Establish an SSH connection with your host VM instance of Bare Metal Solution server.

  2. Run the following command:

    curl http://localhost:18181

    If the metrics are available, then you should receive an XML output containing information about your system. For example:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <metrics>
      <metric category="cpu" context="vm" type="double" unit="Percent" last-refresh="1670422670" refresh-interval="60">
      <name>VM Processing Power Consumption</name>
      <value>0.0</value>
      </metric>

Windows

  1. Use RDP to connect to the VM instance.

  2. As an administrator, run the following command from PowerShell:

    (Invoke-WebRequest -Uri 'http://localhost:18181').RawContent

    If the metrics are available, you should see a XML output containing information about your system. For example:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <metrics>
      <metric category="cpu" context="vm" type="double" unit="Percent" last-refresh="1670422528" refresh-interval="60">
      <name>VM Processing Power Consumption</name>
      <value>10.0</value>
      </metric>

View the other metrics

After you update the configuration of Google Cloud's Agent for SAP to collect the Process Monitoring metrics, Workload Manager evaluation metrics, or the SAP HANA monitoring metrics, you should view them to verify that the agent is collecting the metrics as expected.

You can view the metrics and information collected by Google Cloud's Agent for SAP in Cloud Monitoring by completing the following steps:

  1. In the Google Cloud console, go to the Monitoring Metrics explorer page.

    Go to Metrics explorer

  2. Select the Configuration tab.

  3. Expand the Select a metric menu.

  4. In the Resources menu, select VM instance.

  5. In the Metric category menu, select sap.

  6. In the Metric menu, select metric: workload.googleapis.com/sap/service/active or any of the new metrics to chart.

  7. Click Apply.

You should see a chart with the time series metric values.

Restart the agent

If Google Cloud's Agent for SAP stops working or you update its configuration, then restart the agent.

Select your operating system, and then follow the steps:

Linux

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

  2. Run the following command:

    sudo systemctl restart google-cloud-sap-agent
    

Windows

  1. Establish an RDP connection with your host VM instance.

  2. As an administrator, run the following command from PowerShell:

    Restart-Service -Name 'google-cloud-sap-agent' -Force
    

Upgrade to Google Cloud's Agent for SAP from other Google Cloud agents

Installing Google Cloud's Agent for SAP automatically detects earlier versions of the monitoring agent for SAP NetWeaver and monitoring agent for SAP HANA, disables them, and then removes them from your host machines during installation.

If these Google Cloud agents are detected, then the configurations in their configuration files are also migrated to Google Cloud's Agent for SAP during its installation. For backup and reference purposes, the configuration of the monitoring agent for SAP HANA is copied to the following file:

/etc/google-cloud-sap-agent/backup-of-hanamonitoring-configuration.yaml

For instructions on installing and configuring Google Cloud's Agent for SAP, see Choose your Google Cloud's Agent for SAP installation and configuration guide.

Upgrading SSL-enabled instances

If you have configured the monitoring agent for SAP HANA to use SSL certificates for communication with your SAP HANA instances, then when you install Google Cloud's Agent for SAP, all the SAP HANA monitoring configuration except the SSL configuration are migrated to Google Cloud's Agent for SAP. In such a case, to use Google Cloud's Agent for SAP for monitoring your SAP HANA instances, you must complete the following steps:

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

  2. Open the configuration file of Google Cloud's Agent for SAP:

    /etc/google-cloud-sap-agent/configuration.json
  3. In the hana_monitoring_configuration section, set the parameter enabled to true.

  4. In the hana_monitoring_configuration.hana_instances section, perform the following for each SAP HANA instance that uses the TLS/SSL protocol for secure communication:

    1. Specify the parameter enable_ssl and set its value to true.

    2. Specify the parameter host_name_in_certificate and set the SAP HANA hostname, as specified in the TLS/SSL certificate, as its value.

    3. Specify the parameter tls_root_ca_file and set the path, where the TLS/SSL certificate is stored, as its value.

  5. Save the configuration file.

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

    sudo systemctl restart google-cloud-sap-agent
  7. Verify that the agent is collecting the SAP HANA monitoring metrics. For instructions, see View the other metrics.

  8. Uninstall the monitoring agent for SAP HANA.

If you experience any connection issues with your SAP HANA instances after this upgrade, then you can view the agent's logs in Logging and use the troubleshooting guide to resolve the issue.

Update Google Cloud's Agent for SAP

This section provides steps to check if an updated version of Google Cloud's Agent for SAP is available, and how you can update to version 3.6 (latest) of Google Cloud's Agent for SAP.

If you need to update to a version of the agent that is not the latest one, then contact Cloud Customer Care.

Check for updates

Select your operating system, and then follow the steps:

RHEL

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

  2. Run the following command:

    sudo yum check-update google-cloud-sap-agent

SLES

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

  2. Run the following command:

    sudo zypper list-updates -r google-cloud-sap-agent

Windows

  1. Establish an RDP connection with your host VM instance.

  2. As an administrator, run the following command from PowerShell:

    googet latest google-cloud-sap-agent

Install an update

To update your instance of Google Cloud's Agent for SAP to version 3.6 (latest), select your operating system, and then follow the steps.

If you need to install a version of the agent that is not the latest one, then contact Cloud Customer Care.

RHEL

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

  2. Run the following command:

    sudo yum --nogpgcheck update google-cloud-sap-agent

SLES

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

  2. Run the following command:

    sudo zypper --no-gpg-checks update google-cloud-sap-agent

Windows

  1. Establish an RDP connection with your host VM instance.

  2. As an administrator, run the following command from PowerShell:

    googet install google-cloud-sap-agent

Roll back to using the monitoring agent for SAP HANA

If you want to roll back to using the monitoring agent for SAP HANA and stop using the SAP HANA monitoring feature of Google Cloud's Agent for SAP, then follow these steps:

RHEL

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

  2. To prevent the collection of duplicate metrics, disable the collection of SAP HANA monitoring metrics by Google Cloud's Agent for SAP:

    1. Open the configuration file of Google Cloud's Agent for SAP:

      /etc/google-cloud-sap-agent/configuration.json
    2. In the hana_monitoring_configuration section, set the parameter enabled to false.

    3. Save the configuration file.

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

      sudo systemctl restart google-cloud-sap-agent
  3. Copy the configuration of monitoring agent for SAP HANA from the following file:

    /etc/google-cloud-sap-agent/backup-of-hanamonitoring-configuration.yaml
  4. Install the monitoring agent for SAP HANA version 2. For installation instructions, see Monitoring agent for SAP HANA V2.0 installation and operation guide.

  5. In the following file, paste the configuration of monitoring agent for SAP HANA that you copied in a previous step:

    /usr/sap/google-saphanamonitoring-agent/conf/configuration.yaml
  6. Restart the monitoring agent for SAP HANA:

    sudo systemctl start google-saphanamonitoring-agent

SLES

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

  2. To prevent the collection of duplicate metrics, disable the collection of SAP HANA monitoring metrics by Google Cloud's Agent for SAP:

    1. Open the configuration file of Google Cloud's Agent for SAP:

      /etc/google-cloud-sap-agent/configuration.json
    2. In the hana_monitoring_configuration section, set the parameter enabled to false.

    3. Save the configuration file.

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

      sudo systemctl restart google-cloud-sap-agent
  3. Copy the configuration of monitoring agent for SAP HANA from the following file:

    /etc/google-cloud-sap-agent/backup-of-hanamonitoring-configuration.yaml
  4. Install the monitoring agent for SAP HANA version 2. For installation instructions, see Monitoring agent for SAP HANA V2.0 installation and operation guide.

  5. In the following file, paste the configuration of monitoring agent for SAP HANA that you copied in a previous step:

    /usr/sap/google-saphanamonitoring-agent/conf/configuration.yaml
  6. Restart the monitoring agent for SAP HANA:

    sudo systemctl start google-saphanamonitoring-agent

View the agent's logs in Cloud Logging

By default, the logs for Google Cloud's Agent for SAP are redirected from your VM instances and Bare Metal Solution servers to Cloud Logging.

To view the agent's logs in Logging, follow these steps:

  1. In the Google Cloud console, go to the Logs Explorer page.

    Go to Logs explorer

  2. Go the Query pane.

  3. From the Resources drop-down menu, select Global, and then click Apply.

  4. In the query editor, enter google-cloud-sap-agent.

  5. Click Run query.

You should see the logs generated by the agent instances running on all your VM instances or Bare Metal Solution servers. To filter the logs from a specific machine, use the filters available in the interface.

You can disable this default redirection of agent's logs. To do so, follow these steps:

  1. Establish an SSH connection with your host VM instance of Bare Metal Solution server.

  2. Open the following configuration file:

    /etc/google-cloud-sap-agent/configuration.json
  3. For the parameter log_to_cloud, update the value to false.

  4. Save the configuration file.

  5. Restart the agent for this change to take effect.