Reputation: 101
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
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
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:
Refer to the link for more information on cloud monitoring.
Upvotes: 1