本文及资源最后更新时间 2022-03-19 by sky995
一、安装服务端
打开SSH 克隆代码
git clone https://github.com/cppla/ServerStatus.git
生成服务端程序
cd ServerStatus/server
make
./sergate
没有错误提示,OK,ctrl+c关闭;如果有错误提示,检查35601是否被占用
配置客户端
修改/ServerStatus/server/config.json文件,注意用户名、密码的值需要和客户端一致
{"servers":
[
{
"username": "s01",
"name": "腾讯云上海",
"type": "kvm",
"host": "host1",
"location": "cn",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s02",
"name": "腾讯云广州",
"type": "kvm",
"host": "host2",
"location": "cn",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
}
]
}
复制ServerStatus/status到你的网站目录 后面替换为你的网站目录路径
sudo cp -r ServerStatus/web/* /www/wwwroot/server
保持运行 安装screen
yum install screen 或者 apt-get install screen
创建窗口
screen -S name
运行服务端
参数为设置修改网站的根目录
cd /root/ServerStatus/server
./sergate --config=config.json --web-dir=/www/wwwroot/server
需要添加/删除客户端恢复窗口
screen -x name
二、安装客户端
将/ServerStatus/clients/client-linux.py 上传到客户端目录 配置SERVER地址,用户名,密码
SERVER = "127.0.0.1"
USER = "s01"
PORT = 35601
PASSWORD = "USER_DEFAULT_PASSWORD"
INTERVAL = 1
PROBEPORT = 80
PROBE_PROTOCOL_PREFER = "ipv4" # ipv4, ipv6
PING_PACKET_HISTORY_LEN = 100
CU = "cu.tz.cloudcpp.com"
CT = "ct.tz.cloudcpp.com"
CM = "cm.tz.cloudcpp.com"
......
保持运行 安装screen
yum install screen 或者 apt-get install screen
创建窗口
screen -S tz
python client-linux.py
需要修改参数 恢复窗口
screen -x tz
GITHUB项目地址
https://github.com/cppla/ServerStatus