8

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

 2 years ago
source link: https://www.ioiox.com/archives/82.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.

创建配置文件

推荐直接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
使用域名和 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 更多相关信息请参考以下链接:


本站提供免费和付费的技术支持.你可以通过留言,邮件,TG群的方式来技术交流和免费咨询.同时也可以付费支持的方式获得相关的技术支持,项目部署配置等服务.具体相关详情请点击查看 技术支持页面


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK