synchronization
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2025-08-25 15:57:40 +08:00
commit cee91802b3
106 changed files with 9124 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/bash
#############################################################################################
# 用途: 使用 Sysstat 工具检测 CPU 负载
# 作者: 丁辉
# 更新时间: 2024-05-10
#############################################################################################
# 获取 CPU 使用情况
cpu_usage=$(mpstat 1 1 | awk '/Average:/ {print 100 - $12}')
# 输出 CPU 使用率
echo "当前 CPU 使用率为: $cpu_usage%"
# 根据需要设置 CPU 使用率的阈值
threshold=80
# 检查 CPU 使用率是否超过阈值
if (( $(echo "$cpu_usage > $threshold" | bc -l) )); then
echo "警告: CPU 使用率超过 ${threshold}%!"
fi