Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aaa #4

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
45b9091
Add files via upload
Apr 29, 2017
b28c54b
Update config.json
Apr 29, 2017
d55911c
Delete dark.css
Apr 29, 2017
c4af9fa
# 修复 移除主机名后,手机端显示错位的问题。
Apr 30, 2017
70d2577
Add files via upload
Apr 30, 2017
afdee0a
Add files via upload
Apr 30, 2017
3d9a3d1
Add files via upload
Apr 30, 2017
5a11162
Add files via upload
Apr 30, 2017
2b7c384
Update README.md
Apr 30, 2017
ac51bcf
Add files via upload
May 18, 2017
362854c
Delete dark.png
May 18, 2017
b723fca
Update README.md
Aug 2, 2017
00c9d04
Update README.md
Aug 3, 2017
4250f44
updatex
mvooer Aug 19, 2017
69aa6cd
删除无用背景图片 恢复JS改动
mvooer Aug 20, 2017
4a0949c
Merge pull request #1 from mvooer/master
Aug 20, 2017
dbf5c42
# 去除负载 Load 的值转为小数的代码
Oct 10, 2017
80b828a
# 更换负载 Load 的值为:当前服务器上链接SSR的所有IP总数
Oct 10, 2017
0524231
Update README.md
Oct 10, 2017
5191d71
# 负载Load 优化,并且支持CentOS6系统
Oct 12, 2017
2217d49
Update README.md
Oct 12, 2017
e13e4da
Update client-linux.py
Oct 14, 2017
4421d87
Update README.md
Jan 16, 2018
d20cd39
Update index.html
Jan 21, 2018
e75b8e0
Update README.md
Mar 25, 2018
b625d52
Update client-linux.py
Apr 3, 2018
4920255
Update index.html
Apr 11, 2018
b552745
Update light.css
Apr 20, 2018
cee9e85
Update README.md
May 18, 2018
e3ebb8b
Update network.h
Jun 13, 2018
f358523
Update index.html
Aug 21, 2018
633ed2e
# 优化样式
Aug 21, 2018
455ac84
Update README.md
Aug 21, 2018
bd03b40
# 增加 robots 文件,屏蔽搜索引擎收录
Aug 22, 2018
6e5bef9
Delete autodeploy.py
Aug 31, 2018
7fccaca
Delete .gitignore
Aug 31, 2018
32bf432
Delete client-psutil.py
Aug 31, 2018
fddcd7d
Delete .gitignore
Aug 31, 2018
dbafdef
Delete .gitignore
Aug 31, 2018
e789db7
Add files via upload
Aug 31, 2018
a915ccb
Create LICENSE
Oct 28, 2018
fe3d8bf
Update README.md
Oct 28, 2018
f63c2c7
Doub.io Script Backup
ToyoDAdoubiBackup Nov 19, 2018
a653403
刪除無效逗比雲連結
ToyoDAdoubiBackup Nov 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 Toyo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
197 changes: 123 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# ServerStatus中文版:
# ServerStatus-Toyo:

* ServerStatus中文版是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针~,该云监控(云探针)是ServerStatus( https://github.com/BotoX/ServerStatus )项目的中文(优化)版。
* 在线演示:https://tz.cloudcpp.com
![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)

* ServerStatus-Toyo版是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针~,该云监控(云探针)是ServerStatus( https://github.com/tenyue/ServerStatus )项目的优化/修改版。
* 在线演示:https://tz.toyoo.pw
* 我的博客:https://doub.io/shell-jc3/

# 目录介绍:

Expand All @@ -11,94 +14,140 @@

# 更新说明:

* 20170108, 更新支持所有系统
* 20161205, 去掉无用的IPV6信息,增加服务器总流量监控        
* 20161203, 汉化并简化安装教程
* 2018.08.21, 修改新样式,效果见 https://tz.toyoo.pw
* 2017.10.12, 负载Load 优化,并且支持CentOS6系统
* 2017.10.10, 修改负载 Load 的值为:当前服务器上链接SSR等软件的IP总数(只要软件监听IPv6那么就能统计,例如SSH)
* 2017.04.30, 优化手机显示式样
* 2017.04.29, 去除主机名设定
* 2017.04.27, 增加一键部署脚本

# 安装教程:

【克隆代码】:
```
git clone https://github.com/tenyue/ServerStatus.git
```

【服务端配置】(服务端程序在ServerStatus/web下):
一、生成服务端程序
执行下面的代码下载并运行脚本。
``` bash
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/status.sh && chmod +x status.sh
```
cd ServerStatus/server
make
./sergate
下载脚本后,根据需要安装客户端或者服务端:
``` bash
# 显示客户端管理菜单
bash status.sh c

# 显示服务端管理菜单
bash status.sh s
```
如果没错误提示,OK,ctrl+c关闭;如果有错误提示,检查35601端口是否被占用
运行脚本后会出现脚本操作菜单,选择并输入` 1 `就会开始安装。

二、修改配置文件
修改config.json文件,注意username, password的值需要和客户端对应一致    
```
{"servers":
[
{
"username": "s01",
"name": "Mainserver 1",
"type": "Dedicated Server",
"host": "GenericServerHost123",
"location": "Austria",
"password": "some-hard-to-guess-copy-paste-password"
},
]
}
```
一开始会提示你输入 网站服务器的域名和端口,如果没有域名可以直接回车代表使用` 本机IP:8888`

三、拷贝ServerStatus/status到你的网站目录
例如:
```
sudo cp -r ServerStatus/web/* /home/wwwroot/default
```
## 简单步骤:

四、运行服务端:
web-dir参数为上一步设置的网站根目录,务必修改成自己网站的路径
```
./sergate --config=config.json --web-dir=/home/wwwroot/default
首先安装服务端,安装过程中会提示:

``` bash
是否由脚本自动配置HTTP服务(服务端的在线监控网站)[Y/n]

# 如果你不懂,那就直接回车,如果你想用其他的HTTP服务自己配置,那么请输入 n 并回车。
# 注意,当你曾经安装过 服务端,同时没有卸载Caddy(HTTP服务),那么重新安装服务端的时候,请输入 n 并回车。
```

【客户端配置】(客户端程序在ServerStatus/clients下):
客户端有两个版本,client-linux为普通linux,client-psutil为跨平台版,普通版不成功,换成跨平台版即可。
然后 添加或修改 初始示例的节点配置,注意用户名每个节点配置都不能重复,其他的参数都无所谓了。

然后安装客户端,根据提示填写 服务端的IP 和前面添加/修改 对应的 节点用户名和密码(用于和服务端验证),然后启动就好了,有问题请贴出 详细步骤+日志(如果有)联系我。

一、client-linux版配置:
1、vim client-linux.py, 修改SERVER地址,username帐号, password密码
2、python client-linux.py 运行即可。
# 使用说明:

二、client-psutil版配置:
1、安装psutil跨平台依赖库
2、vim client-psutil.py, 修改SERVER地址,username帐号, password密码
3、python client-psutil.py 运行即可。
进入下载脚本的目录并运行脚本:

``` bash
# 客户端管理菜单
./status.sh c
# 服务端管理菜单
./status.sh s
```
### for Centos:
sudo yum -y install epel-release
sudo yum -y install python-pip
sudo yum clean all
sudo yum -y install gcc
sudo yum -y install python-devel
sudo pip install psutil
### for Ubuntu/Debian:
sudo root
apt-get -y install python-setuptools python-dev build-essential
apt-get -y install python-pip
pip install psutil
### for Windows:
打开网址:https://pypi.python.org/pypi?:action=display&name=psutil#downloads
下载psutil for windows程序包
安装即可

然后选择你要执行的选项即可。

``` bash
ServerStatus 一键安装管理脚本 [vx.x.x]
-- Toyo | doub.io/shell-jc3 --

0. 升级脚本
————————————
1. 安装 服务端
2. 卸载 服务端
————————————
3. 启动 服务端
4. 停止 服务端
5. 重启 服务端
————————————
6. 设置 服务端配置
7. 查看 服务端信息
8. 查看 服务端日志
————————————
9. 切换为 客户端菜单

当前状态: 服务端 已安装 并 已启动

请输入数字 [0-9]:
```
# 其他操作

### 客户端:

启动:service status-client start

停止:service status-client stop

重启:service status-client restart

查看状态:service status-client status

### 服务端:

启动:service status-server start

停止:service status-server stop

重启:service status-server restart

查看状态:service status-server status

### Caddy(HTTP服务):

启动:service caddy start

停止:service caddy stop

重启:service caddy restart

查看状态:service caddy status

Caddy配置文件:/usr/local/caddy/caddy

默认脚本只能一开始安装的时候设置配置文件,更多的Caddy使用方法,可以参考这些教程:https://doub.io/search/caddy

——————————————————————————————————————

安装目录:/usr/local/ServerStatus

网页文件:/usr/local/ServerStatus/web

配置文件:/usr/local/ServerStatus/server/config.json

客户端查看日志:tail -f tmp/serverstatus_client.log

服务端查看日志:tail -f /tmp/serverstatus_server.log

# 其他说明

网络实时流量单位为:G=GB/s,M=MB/s,K=KB/s

打开云探针页面,就可以正常的监控。接下来把服务器和客户端脚本自行加入开机启动,或者进程守护,或以后台方式运行即可!例如: nohup python client-linux.py &
服务器总流量单位为:T=TB,G=GB,M=MB,K=KB

# 为什么会有ServerStatus中文版:
### CentOS7系统 负载显示异常的问题

* 有些功能确实没用
* 原版本部署,英文说明复杂
* 不符合中文版的习惯
* 没有一次又一次的轮子,哪来如此优秀的云探针
CentOS7系统 默认可能没有安装 netstat 依赖,所以会造成IP检测(负载)出错,手动安装即可:
`yum install net-tools -y `

# 相关开源项目,感谢:

Expand Down
Loading