简介
GoMonitor 是一款系统监控代理工具,此脚本支持一键安装、更新、卸载,并自动配置 Systemd 服务。
支持系统
- 所有支持 systemd 的 Linux 发行版(Ubuntu 18.04+、Debian 10+、CentOS 7+ 等)
- 需要 root 权限运行
- 依赖:wget、tar、curl、systemctl
功能
| 动作 | 说明 |
|---|---|
install |
首次安装,自动配置 systemd 服务、设置开机自启 |
update |
更新到最新版本(或指定版本),自动比对版本号 |
uninstall |
停止服务、禁用开机自启、删除二进制和 service 文件 |
参数说明
| 参数 | 说明 |
|---|---|
-v, --version |
指定安装/更新的版本号(如 v0.1.2),不传则下载最新版 |
-m, --mirror |
GitHub 加速镜像前缀,国内服务器推荐使用 |
-k, --key |
服务端 Key(非交互模式) |
-s, --secret |
服务端 Secret(非交互模式) |
安装
安装最新版本
sudo bash gomonitor_install.sh install
安装指定版本
sudo bash gomonitor_install.sh -v v0.1.2 install
使用镜像加速(国内服务器推荐)
sudo bash gomonitor_install.sh -m https://ghproxy.net/ install
可选镜像地址:
https://ghproxy.net/https://gh-proxy.com/(推荐这个速度快)https://mirror.ghproxy.com/
非交互式安装(CI/CD)
sudo bash gomonitor_install.sh -m https://ghproxy.net/ -v v0.1.2 -k "KEY" -s "SECRET" install
使用 -k 和 -s 参数直接传入密钥,跳过交互输入。
更新
更新到最新版本
sudo bash gomonitor_install.sh update
sudo bash gomonitor_install.sh -m https://ghproxy.net/ update
更新到指定版本
sudo bash gomonitor_install.sh -v v0.1.3 update
卸载
sudo bash gomonitor_install.sh uninstall
查看帮助
bash gomonitor_install.sh -h