安装Ops Agent后VM仍显示“Requires Ops Agent”无法查看内存利用率
排查Ops Agent安装后仍显示未安装的问题
1. 验证Agent实际运行状态
登录目标VM,根据系统类型执行对应命令检查Agent是否在运行:
- Debian/Ubuntu系统:
sudo systemctl status google-cloud-ops-agent - RHEL/CentOS系统:
sudo systemctl status google-cloud-ops-agent - Windows系统(PowerShell环境):
Get-Service google-cloud-ops-agent*
若Agent未运行,手动启动:
- Linux:
sudo systemctl start google-cloud-ops-agent - Windows:
Start-Service google-cloud-ops-agent*
2. 检查Agent日志与数据上报情况
查看Agent日志排查是否存在数据上报故障:
- Linux系统查看日志:
sudo tail -n 50 /var/log/google-cloud-ops-agent/subagents.log - Windows系统:通过事件查看器定位到
Applications and Services Logs > Google > Cloud Operations > Ops Agent > Subagents查看日志
若日志出现认证或连接类错误,需确认VM关联的服务账号是否拥有Monitoring Writer和Logging Writer权限。
3. 等待数据同步延迟
Cloud Console概览页数据存在同步延迟,通常需要等待5-10分钟,待Agent完成首次数据上报后再刷新页面。
4. 确认VM网络连通性
确保VM能正常访问Google Cloud的Monitoring和Logging服务:
- Linux系统测试连通性:
curl -I https://monitoring.googleapis.com curl -I https://logging.googleapis.com
若无法访问,检查VM的防火墙规则是否允许443端口的出站流量。
5. 重新安装Agent(以上步骤无效时)
先卸载现有Agent再重新安装:
- Debian/Ubuntu系统:
之后重新执行Cloud Shell中的安装命令。sudo apt-get remove google-cloud-ops-agent sudo apt-get purge google-cloud-ops-agent - RHEL/CentOS系统:
之后重新执行安装命令。sudo yum remove google-cloud-ops-agent sudo yum erase google-cloud-ops-agent - Windows系统(PowerShell环境):
之后重新执行安装命令。& "$env:ProgramFiles\Google\Cloud Operations\Ops Agent\installer\uninstall.ps1"
内容的提问来源于stack exchange,提问作者Calicoder
相关产品推荐
相关产品推荐

