ServerStatus服务器云监控
  • 分类:Linux
  • 发表:2020-03-14
  • 围观(554)
  • 评论(2)

演示地址:http://status.64ml.com/

ServerStatus中文版一个云探针、云监控、服务器云监控、多服务器探针

手动安装:

git clone https://github.com/cppla/ServerStatus.git

【服务端】(ServerStatus/web下):

一、生成服务端程序

cd ServerStatus/server
make
./sergate
如果没错误提示,OK,ctrl+c关闭;如果有错误提示,检查35601端口是否被占用

二、修改配置文件
修改ServerStatus/server下config.json文件,注意username, password的值需要和客户端对应一致

以下是我的

{"servers":
[
{
"username": "TXSH",
"name": "TXSH",
"type": "KVM",
"host": "host1",
"location": "上海",
"password": "123456"
},
{
"username": "TXHK",
"name": "TXHK",
"type": "KVM",
"host": "host1",
"location": "香港",
"password": "123456"
},
{
"username": "UltraVPS",
"name": "UltraVPS",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "Ultra250G",
"name": "Ultra250G",
"type": "KVM",
"host": "host1",
"location": "德国",
"password": "123456"
},
{
"username": "HostHatch",
"name": "HostHatch",
"type": "KVM",
"host": "host1",
"location": "荷兰",
"password": "123456"
},
{
"username": "HostHatch1",
"name": "HostHatch1",
"type": "KVM",
"host": "host1",
"location": "瑞典",
"password": "123456"
},
{
"username": "CloudRaft",
"name": "CloudRaft",
"type": "KVM",
"host": "host1",
"location": "德国",
"password": "123456"
},
{
"username": "AWS-LD",
"name": "AWS-LD",
"type": "KVM",
"host": "host1",
"location": "伦敦",
"password": "123456"
},
{
"username": "AWS-Sin",
"name": "AWS-Sin",
"type": "KVM",
"host": "host1",
"location": "新加坡",
"password": "123456"
},
{
"username": "VirSanJ",
"name": "VirSanJ",
"type": "KVM",
"host": "host1",
"location": "圣何塞",
"password": "123456"
},
{
"username": "VirPs",
"name": "VirPs",
"type": "KVM",
"host": "host1",
"location": "新泽西",
"password": "123456"
},
{
"username": "RN512M30G",
"name": "RN512M30G",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "RN1G18G2.5T",
"name": "RN1G18G2.5T",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "RN2C1.5G5T",
"name": "RN2C1.5G5T",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "RN3C2G35G",
"name": "RN3C2G35G",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "PR9.9",
"name": "PR9.9",
"type": "KVM",
"host": "host1",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "AliHK",
"name": "AliHK",
"type": "KVM",
"host": "host2",
"location": "香港",
"password": "123456"
},
{
"username": "戈登美国",
"name": "戈登美国",
"type": "KVM",
"host": "host3",
"location": "洛杉矶",
"password": "123456"
},
{
"username": "戈登韩国",
"name": "戈登韩国",
"type": "KVM",
"host": "host3",
"location": "韩国",
"password": "123456"
},
{
"username": "戈登日本",
"name": "戈登日本",
"type": "KVM",
"host": "host3",
"location": "日本",
"password": "123456"
},
{
"username": "戈登香港",
"name": "戈登香港",
"type": "KVM",
"host": "host3",
"location": "香港",
"password": "123456"
},
{
"username": "Sentris",
"name": "Sentris",
"type": "OpenVZ",
"host": "host4",
"location": "洛杉矶",
"password": "123456"
}
]
}

三、拷贝ServerStatus/status到的网站目录
如:cp -r ServerStatus/web/* /home/wwwroot/default

四、运行服务端:
web-dir参数为上一步设置的网站根目录,务必修改成自己网站的路径

./sergate --config=config.json --web-dir=/home/wwwroot/default --port=35601

【客户端】(ServerStatus/clients下):

客户端有两个版本,client-linux为普通linux,client-psutil为跨平台版,普通版不成功,换成跨平台版即可。

client-linux版配置:
1、vim client-linux.py, 修改SERVER地址,username帐号, password密码
2、nohup python client-linux.py & 运行。

个人习惯:


vi ServerStatus.py

nohup python ServerStatus.py &

查看原文

   

共有 2 条留言

  1. 卫卫

    添加用户名和密码是服务器的账号密码吗?

    1. leoyum

      不是,随便填个就可以,第二步配置文件config.json中的username, password的值需要和客户端client-linux.py中的对应一致就行


Top