ServerStatus 感觉不错, 记录一下配置过程

最近服务器有点多, 于是打算搞个探针监控一下, hostloc上看到ServerStatus的讨论比较多, 那就选它了!
安装有2种方法, 由于已经先安装了宝塔, 就选择手动安装了.
跟着教程来【克隆代码】:

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

【服务端配置】:
一、生成服务端程序

cd ServerStatus/server
make
./sergate

如果没错误提示,OK,ctrl+c关闭;如果有错误提示,检查35601端口是否被占用.
二、拷贝ServerStatus/status到网站目录
例如:

sudo cp -r ServerStatus/web/* /www/wwwroot/s.obb7.com

三、运行服务端
根据我自己的习惯

yum -y install screen
screen -S oye
cd /home/ServerStatus/server
./sergate --config=config.json --web-dir=/www/wwwroot/s.obb7.com >/dev/null 2>&1

手动重启:

查看进程: ps -ef | grep web
Kill进程: kill -9 xxxx
重新运行: ./sergate --config=config.json --web-dir=/www/wwwroot/s.obb7.com >/dev/null 2>&1

四、客户端运行

wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && nohup python client-linux.py SERVER=监控服务器IP USER=用户名 PASSWORD=密码 >/dev/null 2>&1 &

五、配置服务端config

{
            "username": "用户名",
            "name": "名字",
            "type": "?",
            "host": "host1",
            "location": "??",
            "password": "密码",
            "monthstart": 1
        }

这样基本上就完成了

小 虾

哦也,我是小虾

You may also like...