简介:
ServerStatus是一款广受欢迎的Linux服务器监控工具,它不仅提供了实时的负载监控,还为用户提供了一个直观的Web界面。今天,我们将为您展示如何快速安装ServerStatus,并为您美化其界面。
准备事项: 在进行下一步之前,请确保您的服务器已经更新到最新
测试环境:ubuntu 22.0/centos7.9
更新系统软件包
apt-get update
apt-get upgrade -y
一、安装服务器端:
方案一、脚本安装
1、更新脚本
wget https://raw.githubusercontent.com/cokemine/ServerStatus-Hotaru/master/status.sh
# wget https://cokemine.coding.net/p/hotarunet/d/ServerStatus-Hotaru/git/raw/master/status.sh 若服务器位于中国大陆建议选择 Coding.net 仓库
bash status.sh s
2、安装
选择1.进行安装
2、输入服务的端口
如果有防火墙或者网关,需要打开相应端口。
3、是否自动部署配置文件(默认Y)
4、这里输入域名(没域名输入IP),端口。
5、默认就部署完成了,等会改配置文件
6、修改配置:
重新运行bash status.sh s
选择修改用户信息,比如用户名,用户密码等
或者直接VI编辑,大概是以下这个样子:
vi /usr/local/ServerStatus/server/config.json
{"servers":
[ { "username": "username01",
"password": "password",
"name": "Server 01",
"type": "KVM",
"host": "",
"location": "Hong Kong",
"disabled": false,
"region": "HK"
}
]
}
方案二、下载安装
mkdir -p /usr/local/ServerStatus/server
yum -y install wget unzip curl vim build-essential #centos 系统
#apt-get -y install wget unzip curl vim build-essential #ubuntu 系统
cd /tmp
wget https://github.com/cokemine/ServerStatus-Hotaru/archive/master.zip
unzip master.zip
cd ./ServerStatus-Hotaru-master/server
make #编译生成二进制文件
chmod +x sergate
mv sergate /usr/local/ServerStatus/server
vim /usr/local/ServerStatus/server/config.json #修改配置文件
#下载前端
cd /tmp && wget https://github.com/cokemine/hotaru_theme/releases/latest/download/hotaru-theme.zip
unzip hotaru-theme.zip
mv ./hotaru-theme /usr/local/ServerStatus/web #此为站点根目录,请自行设置
nohup ./sergate --config=config.json --web-dir=/usr/local/ServerStatus/web --port=35601 > /tmp/serverstatus_server.log 2>&1 & #默认端口35601
二、安装客户端:
1、运行命令
bash status.sh
2、根据提示,输入账号密码。
完成客户端安装(手动安装就算了,太费劲了)
三、效果
四、总结:
1、cenots8/ubuntu18 不是太友好,建议用Cenos6/7或者Ubuntu22.04
2、建议多用脚本,比较简单:
bash status.sh s 汇集了服务端操作选项,比较简单好用
bash status.sh c 汇集了服务端操作选项,比较简单好用