-
ServerStatus介绍:
-
ServerStatus中文版是一个酷炫高逼格的云探针、云监控、服务器云监控、多服务器探针~。
-
在线演示:https://tz.cloudcpp.com
-
安装ServerStatus:
-
下载ServerStatus源码:
git clone https://github.com/cppla/ServerStatus.git
git clone http://ghproxy.com/https://github.com/cppla/ServerStatus.git
-
安装ServerStatus:
cd ServerStatus/server
make # 如果不是root用户,使用 'sudo make'
./sergate #启动服务
-
ServerStatus的配置:
客户端配置文件:
ServerStatus/client/client-linux.py
ServerStatus/client/client-psutil.py #windows平台使用
SERVER = "127.0.0.1" #服务端IP
USER = "s01"
PASSWORD = "USER_DEFAULT_PASSWORD"
PORT = 35601 #服务端端口
ServerStatus/server/config.json
{
"servers": [
{
"username": "s01",
"name": "node1",
"type": "xen",
"host": "host1",
"location": "??",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
},
{
"username": "s04",
"name": "node4",
"type": "kvm",
"host": "host4",
"location": "??",
"password": "USER_DEFAULT_PASSWORD",
"monthstart": 1
}
],
#回调/通知
# ! watchdog rule 可以为任何已知字段的表达式。
#! watchdog interval 最小通知间隔。
#! watchdog callback 可自定义为Post方法的URL,告警内容将拼接其后并发起回调。
#! watchdog callback Telegram:https://api.telegram.org/bot你自己的密钥/sendMessage?parse_mode=HTML&disable_web_page_preview=true&chat_id=你自己的标识&text=
#! watchdog callback Server酱: https://sctapi.ftqq.com/你自己的密钥.send?title=ServerStatus&desp=
#! watchdog callback PushDeer: https://api2.pushdeer.com/message/push?pushkey=你自己的密钥&text=
"watchdog": [
{
"name": "cpu high warning",
"rule": "cpu>90&load_1>3",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "memory high warning",
"rule": "(memory_used/memory_total)*100>90",
"interval": 300,
"callback": "https://yourSMSurl"
},
{
"name": "offline warning",
"rule": "online4=0&online6=0",
"interval": 600,
"callback": "https://yourSMSurl"
},
{
"name": "you can parse an expression combining any known field",
"rule": "load_5>3",
"interval": 900,
"callback": "https://yourSMSurl"
}
]
}
添加站点:
网站目录设置:将ServerStatus目录下的web文件夹内所有文件放置于你的网站目录之下
网站端口配置:
开机自启:
ServerStatus/service/status-server.service
ServerStatus/service/status-client.service
成功部署探针,尽情使用吧!
本篇文章来源于微信公众号: 菜但努力
微信扫描下方的二维码阅读本文
Comments NOTHING