云探针Serverstatus
2 分钟 5311 字 |
云探针
云探针用于监控多台服务器的运行状态,分为服务端和客户端,服务端用于集中管理各客户端,客户端用于采集服务器状态,上传至服务端。
服务端
两种方式:docker部署与脚本部署
docker部署
- 安装
cd /root
git clone https://github.com/stilleshan/ServerStatus.git
# docker部署
docker run -d --name=serverstatus --restart=always \
-p 8888:80 \
-p 35601:35601 \
-v ~/ServerStatus/config.json:/ServerStatus/server/config.json \
stilleshan/serverstatus
# 或者docker compose部署
cd ServerStatus
docker-compose up -d
配置:
{"servers":
[
{
# 客户端用户名
"username": "1",
# 客户端密码
"password": "1",
"name": "腾讯云-上海",
"type": "KVM",
"host": "None",
"location": "CN",
"disabled": false
},
{
"username": "2",
"password": "2",
"name": "阿里云-香港",
"type": "KVM",
"host": "None",
"location": "HK",
"disabled": false
}
]
}
配置完成后重启容器:docker restart serverstatus
- 自定义挂载前端页面:
docker run -d --name=serverstatus --restart=always \
-p 8888:80 \
-p 35601:35601 \
-v ~/ServerStatus/config.json:/ServerStatus/server/config.json \
-v ~/ServerStatus/web:/usr/share/nginx/html \
stilleshan/serverstatus
脚本部署
- 下载
wget -N --no-check-certificate https://github.ioiox.com/stilleshan/ServerStatus/raw/branch/master/status.sh && chmod +x status.sh
- 安装
bash status.sh s
以上命令末尾的s代表服务器端,c则代表客户端.也可以输入数字10回车来切换.
选1安装,然后根据选项自行选择
客户端
登录
需要被监控
的服务器安装脚本,与服务端脚本一致
安装客户端:
bash status.sh c
选1安装客户端
输入服务器端的IP,或者服务器端配置的域名
输入服务端端口;
为本台服务器添加用户名及密码
配置服务器端
docker方式
修改config.json文件,添加节点
节点的用户名和密码与客户端设置的一致
脚本方式
bash status.sh s
选7设置服务器配置
访问
参考
[ 1 ] https://www.ioiox.com/archives/27.html
[ 2 ] https://github.com/stilleshan/ServerStatus
~ ~ The End ~ ~
分类标签:教程,docker,服务器
文章标题:云探针Serverstatus
文章链接:http://120.46.217.131:82/archives/52/
最后编辑:2023 年 3 月 4 日 13:38 By Yang
许可协议: 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
文章标题:云探针Serverstatus
文章链接:http://120.46.217.131:82/archives/52/
最后编辑:2023 年 3 月 4 日 13:38 By Yang
许可协议: 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)