there is a customized design version for nanqinlang
Live demo : https://sometimesnaive.org/status/
this repo works as this following :
server
listens on tcp port 65535client
connects to the serverclient
generates statistics and periodically send it to the server(defaultly as 5 seconds)server
writes statistics to~/website/json/stats.json
server
provides HTML page with JavaScript to let users load
include dir :
~/client
client files~/server
server files~/website
website files
git clone https://github.com/nanqinlang-mogic/ServerStatus.git
to modify config file: /ServerStatus/server/config.json
make sure that username and password
must be the same as client
example:
{ "servers":
[
{
"username": "nanqinlang1",
"name": "南琴浪博客",
"type": "KVM",
"location": "LosAngeles",
"password": "nanqinlang",
},
{
"username": "nanqinlang2",
"name": "https://sometimesnaive.org",
"type": "KVM",
"location": "LosAngeles",
"password": "nanqinlang",
}
]
}
cd ~/ServerStatus/server
chmod 7777 ServerStatus
./ServerStatus --config=config.json --web-dir=~/ServerStatus/website(your ServerStatus-website absolute dir)
# background working
nohup ./ServerStatus --config=config.json --web-dir=~/~ &
(then press ctrl+c to quit nohup prempts)
additional, you should keep a http server
to load HTML of ServerStatus
advises to use like nginx
# if use nginx, just add this rule
server {
root ~/ServerStatus/website;
index index.html;
}
this client only works on Linux
vim client.py
# ip of server
SERVER = "x.x.x.x"
# if there are both server and client in your vps, use "127.0.0.1"
# listen port, stay no change
PORT = 65535
# username
USER = "nanqinlang2"
# password
PASSWORD = "nanqinlang"
# statistics update interval(second)
INTERVAL = 5
upload client.py
to your client vps, then
nohup python client.py &
中文文档
https://sometimesnaive.org/article/linux/repo/serverstatus