mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-02-12 15:55:36 +08:00
feat: 前端升级至vue3,后端代码结构重构,新增权限管理相关功能
This commit is contained in:
14
server/devops/infrastructure/machine/shell/monitor.sh
Normal file
14
server/devops/infrastructure/machine/shell/monitor.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# 获取监控信息
|
||||
function get_monitor_info() {
|
||||
cpu_rate=$(cat /proc/stat | awk '/cpu/{printf("%.2f%\n"), ($2+$4)*100/($2+$4+$5)}' | awk '{print $0}' | head -1)
|
||||
mem_rate=$(free -m | sed -n '2p' | awk '{print""($3/$2)*100"%"}')
|
||||
sys_load=$(uptime | cut -d: -f5)
|
||||
cat <<EOF | column -t
|
||||
cpuRate:${cpu_rate},memRate:${mem_rate},sysLoad:${sys_load}
|
||||
EOF
|
||||
}
|
||||
|
||||
get_monitor_info
|
||||
|
||||
Reference in New Issue
Block a user