pugazhendhi_r
pugazhendhi_r

Reputation: 101

Windows Instance in GCP not detected in GCP Monitoring

I have a windows instance without public IP, installed the monitoring agent using the below powershell command:

Launch Powershell as administrator and run the below command:
(New-Object Net.WebClient).DownloadFile("https://dl.google.com/cloudagents/add-google-cloud-ops-agent-repo.ps1", "${env:UserProfile}\add-google-cloud-ops-agent-repo.ps1")
Invoke-Expression "${env:UserProfile}\add-google-cloud-ops-agent-repo.ps1 -AlsoInstall"

It got installed successfully and the service is running, when I check from the GCP console under monitoring section, it is showing as agent not installed.

Upvotes: 1

Views: 629

Answers (2)

FearlessHyena
FearlessHyena

Reputation: 4105

You probably don't have the necessary access scopes for your service account as mentioned here

Add the following access scopes to the service account attached to your Compute Engine instance so verify if you have these first

 - https://www.googleapis.com/auth/logging.write
 - https://www.googleapis.com/auth/monitoring.write

To update the access scopes you might need to stop the instance first

Your agent should appear a few minutes after you add the scopes and restart the instance

If that still doesn't work however, check the agent logs to get a better idea on what's going on

The log can be found at

Windows

C:\ProgramData\Google\Cloud Operations\Ops Agent\log\logging-module.log

Linux

/var/log/google-cloud-ops-agent/subagents/*.log

Upvotes: 0

Srividya
Srividya

Reputation: 2323

You can install the agent on one or more Compute Engine VMs from the pre-configured Monitoring VM Instances dashboard.

The Inventory tab on the VM Instances dashboard lists all VMs and includes a status column for your agent.

The Agent column reports the status as Not detected if it is not detected by cloud monitoring.

Not detected: You don't have an agent installed. If Cloud Monitoring doesn't detect any agents installed on the Compute Engine instance, then you can install an agent by doing the following:

  • Select the VM instances on which you want to install agents.
  • Click the Install agents option on the Instances table, which brings up an installation workflow in the dashboard, and follow the instructions. The Ops Agent is the default agent that is installed, but the installation workflow provides a link to install the legacy agents.

Refer to the link for more information on cloud monitoring.

Upvotes: 1

Related Questions