一键部署agent脚本说明(Linux版amd64),其他版本agent请先手动下载部署下
这个目前是只适用于Linux版本的agent一键部署,会默认自动下载agent-linux-amd64-v3.4.0.tar.gz(其他版本往下有说明),并自动部署启动
1、先在目标监控主机创建一个文件夹wgcloud(其他名称也可以的),然后进入wgcloud文件夹
2、然后执行下面脚本,注意别忘了把http://localhost:9999替换为自己的server主机实际IP和端口
下面脚本是部署v3.4.0的agent
若要部署v3.3.9,将wget指令中的installAgent-v3.4.0.sh改为installAgent-v3.3.9.sh即可
若要部署v3.3.8,将wget指令中的installAgent-v3.4.0.sh改为installAgent-v3.3.8.sh即可
若要部署v3.3.7,将wget指令中的installAgent-v3.4.0.sh改为installAgent-v3.3.7.sh即可

[root@VM-0-14-centos /]# mkdir wgcloud
[root@VM-0-14-centos /]# cd wgcloud
[root@VM-0-14-centos wgcloud]# wget --no-check-certificate https://www.wgstart.com/download/sh/installAgent-v3.4.0.sh; bash installAgent-v3.4.0.sh http://localhost:9999
--2022-08-14 08:23:12--  https://www.wgstart.com/download/sh/installAgent-v3.4.0.sh
Resolving www.wgstart.com (www.wgstart.com)... 173.242.119.21
Connecting to www.wgstart.com (www.wgstart.com)|173.242.119.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 537 [application/octet-stream]
Saving to: ‘installAgent-v3.4.0.sh’

installAgent-v3.4.0.sh                          100%[======================================================================================================>]     537  --.-KB/s    in 0s      

2022-08-14 08:23:13 (65.2 MB/s) - ‘installAgent-v3.4.0.sh’ saved [537/537]

开始下载agent-linux-amd64-v3.4.0.tar.gz------
--2022-08-14 08:23:13--  https://www.wgstart.com/download/3.4.0/agent-linux-amd64-v3.4.0.tar.gz
Resolving www.wgstart.com (www.wgstart.com)... 173.242.119.21
Connecting to www.wgstart.com (www.wgstart.com)|173.242.119.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6215782 (5.9M) [application/octet-stream]
Saving to: ‘agent-linux-amd64-v3.4.0.tar.gz’

agent-linux-amd64-v3.4.0.tar.gz                 100%[======================================================================================================>]   5.93M  6.44MB/s    in 0.9s    

2022-08-14 08:23:14 (6.44 MB/s) - ‘agent-linux-amd64-v3.4.0.tar.gz’ saved [6215782/6215782]

下载完成------
agent-linux-amd64-v3.4.0/
agent-linux-amd64-v3.4.0/README.txt
agent-linux-amd64-v3.4.0/stop.sh
agent-linux-amd64-v3.4.0/wgcloud-agent-release
agent-linux-amd64-v3.4.0/log/
agent-linux-amd64-v3.4.0/config/
agent-linux-amd64-v3.4.0/config/application.properties
agent-linux-amd64-v3.4.0/start.sh
修改config/application.properties的配置项serverUrl------
修改完成------
部署下载已完成,开始启动agent------
./wgcloud-agent-release

wgcloud-agent程序开始启动

3、部署完成,其他监控主机部署也是如上操作
如果server端的通信密钥wgToken(server/config/application.yml中配置项wgToken)默认值已被修改,也记得修改agent中的通信密钥wgToken(agent/config/application.yml中配置项wgToken),和server的wgToken保持一致
#通信token,请和server端配置的wgToken保持一致
wgToken=wgcloud
4、一键部署agent脚本视频讲解
5、如果是内网、局域网,无法访问外网,想使用一键部署agent脚本,把agent-linux-amd64-v3.4.0.tar.gz下载并复制到server/logo下
然后把installAgent-v3.4.0.sh脚本,下载并复制到server/logo下,然后编辑installAgent-v3.4.0.sh,把里面的https://www.wgstart.com/download/3.4.0/
都改为http://[server主机IP:9999]/wgcloud/resources/,然后就可以在被监控主机执行内网版的一键部署脚本了,如下
wget --no-check-certificate http://[server主机IP:9999]/wgcloud/resources/installAgent-v3.4.0.sh; bash installAgent-v3.4.0.sh http://localhost:9999