如图效果,显示未安装则需手动安装插件,运行中则说明插件已安装完毕并在运行
卸载Agent(没安装正确就先卸载)
cd /usr/local/uniagent/script/
./uninstall.sh
删除cd /usr/local/目录下agent_install.sh
1.安装agent
cd /usr/local && curl -k -O https://obs.cn-north-4.myhuaweicloud.com/uniagent-cn-north-4/script/agent_install.sh && bash agent_install.sh
2 先查看状态
if [[ -f /usr/local/uniagent/extension/install/telescope/bin/telescope ]]; then /usr/local/uniagent/extension/install/telescope/bin/telescope -v; elif [[ -f /usr/local/telescope/bin/telescope ]]; then echo "old agent"; else echo 0; fi
(显示版本号说明是新agent)
3.进入bin目录修改conf.json配置文件
vim /usr/local/uniagent/extension/install/telescope/bin/conf.json
{
"InstanceId":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
"ProjectId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"AccessKey": "XXXXXXXXXXXXXXXXXXXX",
"SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"RegionId": "cn-north-4",
"ClientPort": 0,
"PortNum": 200
}
# ClientPort :Agent占用的起始端口号。默认为0,表示随机占用。1-1023为系统保留端口,建议不要配置。
# PortNum :Agent占用的范围的个数。默认为200,若ClientPort配置5000,则表示在5000-5199端口中随机占用
# RegionId:区域的意思 cn-north-4=华北-北京四的区域
# 其他xxxx都是一些秘钥凭证可以自己上传密钥证书修改创建授权
4.修改完好 我们查看一下agent状态
/usr/local/uniagent/extension/install/telescope/telescoped status
#"Telescope process is running well." 显示此行为正常
5.启动agent
/usr/local/uniagent/extension/install/telescope/telescoped start
接着去华为云上查看,插件运行一切正常,服务器监控数据显示全面