Contact us at google-cloud-ops-agent@google.com if you have any questions, need support, or would like to offer feedback.
The Ops Agent collects logs and metrics on Compute Engine instances, sending your logs to Cloud Logging and your metrics to Cloud Monitoring.
Before you begin
To install the agent, ensure that you have the following:
A supported VM instance in a Google Cloud project.
Credentials on the VM instance that authorize communication with Cloud Logging and Cloud Monitoring. Compute Engine VM instances generally have the correct credentials by default. If you are running very old Compute Engine instances or if you created Compute Engine instances without the default credentials, then you might not have the proper credentials. You must complete the Authorizing the agent procedures.
Ensure your VM doesn't have the standalone Cloud Logging agent or Cloud Monitoring agent installed on it. This can cause ingestion of duplicate logs or a conflict in metrics ingestion. In addition, this agent uses new configuration files that are not compatible with the old agents.
If you have the old agents installed, save the custom configuration files for the Cloud Monitoring agent and the custom configuration files for the Cloud Logging agent, and complete the uninstall steps for the Cloud Monitoring agent and the uninstall steps for the Cloud Logging agent.
VMs without remote package access
Installing the Google Cloud's operations suite agent requires access to remote package repositories, for both the agent package and (on Linux) its dependencies.
If you are using VPC-SC or a private network, the network configuration might also affect your ability to install agent dependencies from upstream repositories. The agent packages themselves are accessible by using Private Google Access.
If your VM host's security policy denies access to remote package repositories, we recommend creating a custom VM image with the agent pre-installed and disabling package management in that image.
Installing the agent on a single VM
To install the agent, use the following instructions.
Installing the latest version of the Ops Agent
To install the latest version of the agent, complete the following steps.
LINUX
Open a terminal connection to your VM instance using SSH or a similar tool and ensure you have
sudo
access.Change to a directory you have write access to, for example your home directory.
Run:
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh sudo bash add-google-cloud-ops-agent-repo.sh --also-install
WINDOWS
Connect to your instance using RDP or a similar tool and login to Windows.
Open a PowerShell terminal with administrator privileges by right-clicking the PowerShell icon and selecting Run as Administrator.
Run the following PowerShell commands:
googet addrepo google-cloud-ops-agent-windows https://packages.cloud.google.com/yuck/repos/google-cloud-ops-agent-windows-all googet -noconfirm install google-cloud-ops-agent
Installing a specific version of the Ops Agent
To install a specific version of the agent, complete the following steps.
CENTOS / RHEL
Open a terminal connection to your VM instance using SSH or a similar tool and ensure you have
sudo
access.Change to a directory you have write access to, for example your home directory.
Add the agent's package repository:
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh sudo bash add-google-cloud-ops-agent-repo.sh
Install the agent:
List the available versions of the agent in order to select which version to install:
sudo yum list --showduplicates google-cloud-ops-agent
For production environments, you might want to pin to a major version to avoid pulling in major versions that might include backward incompatible changes. To pin to a major version, run:
sudo yum install -y google-cloud-ops-agent-major-version.*
For example, to pin to the 1.x.x of the agent, run:
sudo yum install -y google-cloud-ops-agent-1.*
If you don't want to pin to a major version, you can select one of the other installation options:
To install a specific version of the agent, run:
sudo yum install -y google-cloud-ops-agent-version-number
To install the latest version of the agent, run:
sudo yum install -y google-cloud-ops-agent
You can delete the installation script after it runs successfully.
To verify that the agent is working as expected, run:
sudo systemctl status google-cloud-ops-agent"*"
The status of the agent should be OK.
If you have trouble with the installation, refer to the Troubleshooting page.
DEBIAN / UBUNTU
Open a terminal connection to your VM instance using SSH or a similar tool and ensure you have
sudo
access.Change to a directory you have write access to, for example your home directory.
Add the agent's package repository:
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh && \ sudo bash add-google-cloud-ops-agent-repo.sh && \ sudo apt-get update
Install the agent:
List the available versions of the agent in order to select which version to install:
sudo apt-cache madison google-cloud-ops-agent
For production environments, you might want to pin to a major version to avoid pulling in major versions that might include backward incompatible changes. To pin to a major version, run:
sudo apt-get install -y 'google-cloud-ops-agent=major-version.*'
For example, to pin to the 1.x.x of the agent, run:
sudo apt-get install -y 'google-cloud-ops-agent=1.*'
If you don't want to pin to a major version, you can select one of the other installation options:
To install a specific version of the agent, run:
sudo apt-get install -y google-cloud-ops-agent=version-number
To install the latest version of the agent, run:
sudo apt-get install -y google-cloud-ops-agent
You can delete the installation script after it runs successfully.
To verify that the agent is working as expected, run:
sudo systemctl status google-cloud-ops-agent"*"
The status of the agent should be OK.
If you have trouble with the installation, refer to the Troubleshooting page.
SLES / SUSE
Open a terminal connection to your VM instance using SSH or a similar tool and ensure you have
sudo
access.Change to a directory you have write access to, for example your home directory.
Add the agent's package repository:
curl -sSO https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.sh sudo bash add-google-cloud-ops-agent-repo.sh
Install the agent:
List the available versions of the agent in order to select which version to install:
sudo zypper search -s google-cloud-ops-agent
For production environments, you might want to pin to a major version to avoid pulling in major versions that might include backward incompatible changes. To pin to a major version, run:
sudo zypper install -y 'google-cloud-ops-agent<major-version.0.0'
For example, to pin to the 1.x.x of the agent, run:
sudo zypper install -y 'google-cloud-ops-agent<2.0.0'
If you don't want to pin to a major version, you can select one of the other installation options:
To install a specific version of the agent, run:
sudo zypper install -y google-cloud-ops-agent=version-number
To install the latest version of the agent, run:
sudo zypper install -y google-cloud-ops-agent
You can delete the installation script after it runs successfully.
To verify that the agent is working as expected, run:
sudo systemctl status google-cloud-ops-agent"*"
The status of the agent should be OK.
If you have trouble with the installation, refer to the Troubleshooting page.
WINDOWS
To install the agent on a VM instance running Windows, perform the following steps:
Connect to your instance using RDP or a similar tool and login to Windows.
Open a PowerShell terminal with administrator privileges by right-clicking the PowerShell icon and selecting Run as Administrator.
Run the following PowerShell command:
Add the agent's package repository if you have not yet done so:
googet addrepo google-cloud-ops-agent-windows https://packages.cloud.google.com/yuck/repos/google-cloud-ops-agent-windows-all
To list the available versions, run:
googet available google-cloud-ops-agent
To install a specific version, run:
googet -noconfirm install google-cloud-ops-agent.x86_64.version-number
For example:
googet -noconfirm install google-cloud-ops-agent.x86_64.1.0.1@1
To verify that the agent is working as expected, run:
Get-Service google-cloud-ops-agent
The status of the agent should be
Running
.If you have trouble with the installation, refer to the Troubleshooting page.
Optional tasks
This section describes how to perform common maintenance tasks.
Determining the agent version
To determine the version of the Google Cloud's operations suite agent on your system, run the following commands on your VM instance:
CENTOS / RHEL
Run the following command on Red Hat or CentOS Linux:
rpm --query --queryformat '%{NAME} %{VERSION} %{RELEASE} %{ARCH}\n' \
google-cloud-ops-agent
DEBIAN / UBUNTU
Run the following command on Debian or Ubuntu:
dpkg-query --show --showformat \
'${Package} ${Version} ${Architecture} ${Status}\n' \
google-cloud-ops-agent
SLES / SUSE
Run the following command on SUSE:
rpm --query --queryformat '%{NAME} %{VERSION} %{RELEASE} %{ARCH}\n' \
google-cloud-ops-agent
WINDOWS
Run the following command on Windows:
googet installed google-cloud-ops-agent
Restarting the agent
You must restart the Google Cloud's operations suite agent to pick up changes in configuration files. To restart the agent, use the following instructions.
LINUX
Run the following command on your instance:
sudo systemctl restart google-cloud-ops-agent.target
WINDOWS
Connect to your instance using RDP or a similar tool and login to Windows.
Open a PowerShell terminal with administrator privileges by right-clicking the PowerShell icon and selecting Run as Administrator.
Run the following PowerShell command:
Restart-Service google-cloud-ops-agent -Force
Upgrading the agent
To upgrade the Google Cloud's operations suite agent to the latest release, use the following instructions:
CENTOS / RHEL
Run the following command on Red Hat or CentOS Linux:
sudo yum upgrade google-cloud-ops-agent
DEBIAN / UBUNTU
Run the following commands on Debian or Ubuntu:
sudo apt update && sudo apt install --only-upgrade google-cloud-ops-agent
SLES / SUSE
Run the following command on SUSE:
sudo zypper update google-cloud-ops-agent
WINDOWS
To upgrade to the latest agent release:
Connect to your instance using RDP or a similar tool and login to Windows.
Open a PowerShell terminal with administrator privileges by right-clicking the PowerShell icon and selecting Run as Administrator.
Run the following PowerShell commands to remove your installed agent and to run the installation command:
googet -noconfirm remove google-cloud-ops-agent googet -noconfirm install google-cloud-ops-agent
Uninstalling the agent
To remove the Google Cloud's operations suite agent and its configuration files, use the following instructions.
CENTOS / RHEL
Run the following command on Red Hat or CentOS Linux:
sudo yum remove google-cloud-ops-agent
DEBIAN / UBUNTU
Run the following command on Debian or Ubuntu:
sudo apt remove google-cloud-ops-agent
SLES / SUSE
Run the following command on SUSE Linux:
sudo zypper remove google-cloud-ops-agent
WINDOWS
To uninstall the Ops Agent, follow the following steps:
Connect to your instance using RDP or a similar tool and login to Windows.
Open a PowerShell terminal with administrator privileges by right-clicking the PowerShell icon and selecting Run as Administrator.
Run the following PowerShell command:
googet -noconfirm remove google-cloud-ops-agent