Linux 服务器 docker 部署 ServerStatus 服务器监控程序

前言

本站早前介绍过通过一键脚本安装 ServerStatus 来监控多台服务器的运行状态.近期将其构建为 docker 镜像,并整合了美化版前端Web.支持 Linux 服务器 docker 和群晖NAS的 docker 部署.

部署

创建配置文件

推荐直接git clone本仓库到服务器/root目录内.或者手动下载仓库中的config.json/root/ServerStatus/目录内.

cd /root
git clone https://github.com/stilleshan/ServerStatus.git

启动容器

示例8888端口为 Web 访问端口,35601为客户端通信端口,根据需求自行修改映射端口.注意防火墙需放行此端口.

docker run -d --name=serverstatus --restart=always -p 8888:80 -p 35601:35601 -v ~/ServerStatus/config.json:/ServerStatus/server/config.json stilleshan/serverstatus

访问地址

http://服务器IP:8888

495252319-1

 

使用域名和 HTTPS 协议可配置 Nginx 反向代理

配置

config.json为服务器端配置文件,默认已经添加示例配置,可以根据示例格式修改,删除或者增加服务器.修改完毕后重启容器.

docker restart serverstatus

自定义前端页面

上述默认启动命令没有挂载 web 目录,如需自定义修改前端页面,需git clone本仓库到服务器/root目录内,执行以下命令挂载 web 目录.

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

客户端

客户端需获取客户端服务器的运行情况,建议使用一键脚本安装.可参考图文教程: 服务器安装ServerStatus监控探针教程

wget -N --no-check-certificate https://raw.githubusercontent.com/stilleshan/ServerStatus/master/status.sh && chmod +x status.sh && bash status.sh c

结语

关于 ServerStatus 更多相关信息请参考以下链接:

项目仓库 stilleshan/ServerStatus

© 版权声明
THE END
喜欢就支持一下吧
点赞10赞赏 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容