Problem updating legacy agent to OPs agent

829 views
Skip to first unread message

D- wocs

unread,
Jan 10, 2022, 11:55:36 AM1/10/22
to gce-discussion
Running single instance e2-Micro, followed instruction to install it using cloud shell. Installation seems successful, but the agent still shows legacy. Anyone else run into this issue yet, how did you fix it?

---------------------Getting output-------------------------
Progress: |==================================================| 100.0% [1/1] (100.0%) completed; [1/1] (100.0%) succeeded; [0/1] (0.0%) failed;
Instance: projects/x/zones/us-east1-b/instances/instance-1 successfully runs ops-agent. See log file in: ./google_cloud_ops_agent_provisioning/20220109-184625_752756/x_us-east1-b_instance-1.log

SUCCEEDED: [1/1] (100.0%)
FAILED: [0/1] (0.0%)
COMPLETED: [1/1] (100.0%)

See script log file: ./google_cloud_ops_agent_provisioning/20220109-184625_752756/wrapper_script.log

Here are the wrapper_script.log output
022-01-09T18:46:25.753 INFO Starting to read entries from file agents_to_install.csv.
2022-01-09T18:46:25.753 INFO Finished reading entried from file agents_to_install.csv.
2022-01-09T18:46:25.753 INFO Starting to parse and validate entries.
2022-01-09T18:46:25.753 INFO Parsed and validated all entries successfully.
2022-01-09T18:46:25.753 INFO Starting tasks on instances.
2022-01-09T18:46:25.753 INFO Starting process on instance: projects/x/zones/us-east1-b/instances/instance-1.
2022-01-09T18:46:25.753 INFO Instance: instance-1 - Starting process to run command: gcloud compute ssh instance-1 --x --zone us-east1-b --strict-host-key-checking=no --ssh-flag '-o ConnectTimeout=20' --command "echo \"$(date -Ins) Starting running commands.\";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  --uninstall-standalone-logging-agent --uninstall-standalone-monitoring-agent; :; for i in {1..3}; do if (ps aux | grep 'opt[/].*google-cloud-ops-agent.*bin/'); then echo 'google-cloud-ops-agent runs successfully.'; break; fi; sleep 1s; done;echo \"$(date -Ins) Finished running commands.\"".
2022-01-09T18:46:40.321 INFO Processed 1 VMs in 14.56937837600708 seconds.

Derek Murphy

unread,
Jan 10, 2022, 12:53:40 PM1/10/22
to gce-discussion

Hello,

I was wondering if you could provide me with the documentation(link) that you followed and as well the exact command that you used? This may help me find a solution to your issue.

D- wocs

unread,
Jan 11, 2022, 6:00:20 AM1/11/22
to gce-discussion
When logged in GCP > monitoring > dashboard > instance 
If you have a legacy agent, when you check the box on the left of the instance it provides you with an option above the instance to install agent as shown in the attached picture.

Here it is, removed project and instance name from command.

:> agents_to_install.csv && \
echo '"<autogenerated project and instance name removed>","[{""type"":""ops-agent""}]"' >> agents_to_install.csv && \
curl -sSO https://dl.google.com/cloudagents/mass-provision-google-cloud-ops-agents.py && \
python3 mass-provision-google-cloud-ops-agents.py --file agents_to_install.csv

I also tried using this guide when that failed but no success.

Thanks.
Screen Shot 2022-01-10 at 9.47.09 PM.png

Derek Murphy

unread,
Jan 14, 2022, 12:39:18 PM1/14/22
to gce-discussion

I have been looking for more information about this issue, I was wondering if you removed the Legacy agent before attempting to upgrade to the Ops Agent as per the instructions here[1]?


[1] Migrating from the legacy agents to the Ops Agent :  https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/transition#migrate_legacy

Reply all
Reply to author
Forward
0 new messages