基于ThinkPHP5.1的服务器监控平台,需要配合服务端python脚本,使用Redis存储相关数据。
git clone https://github.com/LittleJake/server-monitor
cd server-monitor
composer install
cp .env.example .env
php think token help
vim .env
php think refresh:cache
{
"Disk": {
// Based on different mountpoint.
"mountpoint": {
"total": "0.00",
"used": "0.00",
"free": "0.00",
"percent": 0
},
},
"Memory": {
"Mem": {
"total": "0.00",
"used": "0.00",
"free": "0.00",
"percent": 0.0
},
"Swap": {
"total": "0.00",
"used": "0.00",
"free": "0.00",
"percent": 0.0
}
},
"Load": {
// Metrics based on platform.
"metric": 0.0
},
"Network": {
"RX": {
"bytes": 0,
"packets": 0
},
"TX": {
"bytes": 0,
"packets": 0
}
},
"Thermal": {
// Celsius
"sensor": 0.0,
},
"Battery": {
"percent": 0.0,
}
}
{
"CPU": "",
"System Version": "",
"IPV4": "masked ipv4",
"IPV6": "masked ipv6",
"Uptime": "time in readable form",
"Connection": "",
"Process": "",
"Load Average": "",
"Update Time": "",
"Country": "extract from ip-api.com",
"Country Code": "extract from ip-api.com",
"Throughput": "Gigabytes",
}
Thanks for the amazing VM server provided by DartNode.
Thanks for the open source project license provided by JetBrains.