云探针Serverstatus

  2 分钟   5311 字    |    

云探针

云探针用于监控多台服务器的运行状态,分为服务端和客户端,服务端用于集中管理各客户端,客户端用于采集服务器状态,上传至服务端。

服务端

两种方式:docker部署与脚本部署

docker部署

  1. 安装
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
  1. 访问:http://服务器IP:8888

  2. 配置:

{"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

  1. 自定义挂载前端页面:
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

脚本部署

  1. 下载
wget -N --no-check-certificate https://github.ioiox.com/stilleshan/ServerStatus/raw/branch/master/status.sh && chmod +x status.sh
  1. 安装
bash status.sh s
以上命令末尾的s代表服务器端,c则代表客户端.也可以输入数字10回车来切换.

选1安装,然后根据选项自行选择image-20230211210032436

客户端

  1. 登录需要被监控的服务器

  2. 安装脚本,与服务端脚本一致

  3. 安装客户端:bash status.sh c

  4. 选1安装客户端image-20230211210329333

输入服务器端的IP,或者服务器端配置的域名image-20230211210348752

输入服务端端口;
为本台服务器添加用户名及密码image-20230211210446664

配置服务器端

docker方式

修改config.json文件,添加节点image-20230211210758214

节点的用户名和密码与客户端设置的一致

脚本方式

bash status.sh s

选7设置服务器配置image-20230211210958584

访问

image-20230211211328056

参考

[ 1 ] https://www.ioiox.com/archives/27.html

[ 2 ] https://github.com/stilleshan/ServerStatus

~  ~  The   End  ~  ~


 赏 
感谢您的支持,我会继续努力哒!
支付宝收款码
tips
文章二维码 分类标签:教程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)
(*) 8 + 3 =
快来做第一个评论的人吧~