ServerStatus 云监控探针安装
好东西不解释!
注意:ServerStatus 客户端需要 Python 2.7版本以上才可以正常运行
20211010 更新:toyo的一键好像有问题?可以github找找别的脚本,比如
https://github.com/stilleshan/ServerStatus
下载脚本:
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/status.sh && chmod +x status.sh
显示客户端|被监控管理菜单:
bash status.sh c
显示服务端|主控管理菜单:
bash status.sh s
客户端|被监控管理菜单:
./status.sh c
服务端|主控端管理菜单:
./status.sh s
客户端|被监控:
启动:/etc/init.d/status-client start
停止:/etc/init.d/status-client stop
重启:/etc/init.d/status-client restart
查看状态:/etc/init.d/status-client status
服务端|主控端:
启动:/etc/init.d/status-server start
停止:/etc/init.d/status-server stop
重启:/etc/init.d/status-server restart
查看状态:/etc/init.d/status-server status
Caddy(HTTP服务):
安装目录:/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
CentOS7系统 负载显示异常的问题:
默认可能没有安装 netstat 依赖,所以会造成IP检测(负载)出错,手动安装即可:
yum install net-tools -y
提示wget: unknown host “raw.githubusercontent.com” 之类的错误:
更换DNS为谷歌DNS(以下两行一起复制 一起执行):
echo -e "nameserver 8.8.8.8
nameserver 8.8.4.4" > /etc/resolv.conf
Caddy启动失败,打开 http://ip 显示的是 It works !
一些系统会自带 apache2 ,而 apache2 会占用80端口,导致Caddy无法绑定端口。
netstat -lntp
我们可以通过以上命令查看是不是被其他软件占用了 80 端口
停止 Apache2:
service apache2 stop
尝试使用上面这个关闭,如果没效果或者提示什么错误无法关闭,那就用下面这个强行关闭进程:
kill -9 $(ps -ef|grep "apache2"|grep -v "grep"|awk '{print $2}')
取消开机自启动:
CentOS 系统:
chkconfig --del httpd
Debian/Ubuntu 系统:
update-rc.d -f apache2 remove
卸载 Apache2(卸载包括了取消开机启动,无需重复):
CentOS 系统:
yum remove httpd
Debian/Ubuntu 系统:
apt-get remove --purge apache2
关闭 Apache2后,就可以尝试启动 Caddy ,并试试能不能打开网页:
service caddy start
脚本来自逗比