⚡ CPU
+ +| PID | +用户 | +CPU% | +内存% | +启动时间 | +进程 | +
|---|
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..995faae --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +*.db +*.fpk +export_config.json +.env +.gitignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e958b94 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# Use an official Python runtime as a parent image +FROM python:3.9-slim-bullseye + +# Set the working directory in the container +WORKDIR /app + +# Install system dependencies (for psutil if needed) +RUN apt-get update && apt-get install -y \ + smartmontools \ + net-tools \ + iproute2 \ + procps \ + lm-sensors \ + --no-install-recommends && \ + rm -rf /var/lib/apt/lists/* + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Make port 5000 available to the world outside this container +EXPOSE 5000 + +# Run app.py when the container launches +CMD ["python3", "app.py"] diff --git a/README-FORUM.md b/README-FORUM.md new file mode 100644 index 0000000..55b05b0 --- /dev/null +++ b/README-FORUM.md @@ -0,0 +1,192 @@ + 1|# 💻 fnmon — fnOS 全功能系统监控面板 + 2| + 3|> 一款专为飞牛 fnOS 打造的**实时系统监控面板**,一个 Docker 命令即可拥有媲美专业 NAS 监控的 Web 界面! + 4| + 5|--- + 6| + 7|## 🎯 简介 + 8| + 9|**fnmon**是一个轻量级的 Web 监控工具,以 Docker 容器方式运行在飞牛系统上。无需安装额外驱动、无需修改系统文件,一条命令跑起来就能用。 + 10| + 11|它提供了传统 NAS 系统(如群晖 DSM、威联通 QTS)才有的可视化监控体验,但专为飞牛 OS 深度定制。 + 12| + 13|--- + 14| + 15|## ✨ 功能亮点 + 16| + 17|### ⚡ CPU 监控 + 18|- 实时频率显示(每个核心独立展示) + 19|- Governor / EPP 运行模式 + 20|- 核心温度(支持 SATA/HDD/SDD/NVMe) + 21|- Turbo Boost / 超频检测 + 22|- 60 秒频率历史曲线图 + 23|- **CPU 评测跑分数据**(PassMark、Cinebench、Geekbench) + 24|- **同级 CPU 横向对比柱状图**(N100/J4125/i5-8400T/i3-12100...) + 25| + 26|### 🧠 内存监控 + 27|- 总容量 / 已用 / 可用 / 缓存 + 28|- SWAP 使用情况 + 29|- 内存历史趋势图 + 30| + 31|### 🌐 网络监控 + 32|- 实时网速(上传/下载) + 33|- 总流量统计 + 34|- **Docker 容器流量排行**(哪个容器最占带宽一目了然) + 35|- 按日/月/年统计 + 36| + 37|### 💾 磁盘监控 + 38|- 所有磁盘设备列表 + 39|- **物理硬盘健康状态**(SMART 信息) + 40| - 🌡 硬盘温度 + 41| - ❤️ NVMe 寿命百分比 + 42| - ✅ SATA 健康状态(PASSED/FAILED) + 43| - 🔄 通电时间 + 44| - 💾 总写入量 + 45| + 46|### 📱 应用用量排行 + 47|- 综合 CPU + 内存 + 网络 三维度评分 + 48|- 按 **日/周/月/年/总计** 排行 + 49|- 一键切换时间维度 + 50| + 51|### 🔝 进程 CPU 占用排行(TOP 20) + 52|- 实时刷新,按 CPU 占用排序 + 53|- 显示 PID、用户、启动时间 + 54|- CPU% 颜色标识(红 > 50% / 橙 > 20% / 黄 > 5%) + 55| + 56|--- + 57| + 58|## 📷 界面预览 + 59| + 60|``` + 61|+----------------------------------------------------------+ + 62|| ⚡ CPU i3-9100T@ 3.10GHz 💠 4C | + 63|| Governor EPP 温度 频率范围 负载 风扇 模式 Boost | + 64|| ███████ ███ ███ ███████ ███ ███ ███ ████████ | + 65|+----------------------------------------------------------+ + 66|| [CPU0 799MHz ████] [CPU1 800MHz ████] | + 67|| [CPU2 799MHz ████] [CPU3 800MHz ████] | + 68|+----------------------------------------------------------+ + 69|| 📈 频率历史 (60s) | + 70|| ╱╲ | + 71|| ╱ ╲___ 频率曲线图 | + 72|+----------------------------------------------------------+ + 73|| 🆚 同级CPU对比 (PassMark多核) | + 74|| i3-9100T ← 你 ██████████ 5500 | + 75|| i5-8400T ████████████████ 8500 | + 76|| N100 ████████ 4200 | + 77|+----------------------------------------------------------+ + 78|| 📊 性能评测 | + 79|| PassMark: 5500 Cinebench: 3200 Geekbench: 3500 | + 80|+----------------------------------------------------------+ + 81|| 🔝 进程排行 | PID | 用户 | CPU% | 内存 | 启动 | 进程名 | + 82|+----------------------------------------------------------+ + 83|``` + 84| + 85|(实际界面为深色主题,数据实时刷新,更美观) + 86| + 87|--- + 88| + 89|## 🚀 快速安装 + 90| + 91|### 方式一:Docker 一键运行(推荐 👍) + 92| + 93|```bash + 94|docker run -d \ + 95| --name fnmon \ + 96| -p 5000:5000 \ + 97| --privileged \ + 98| -v /proc:/proc:ro \ + 99| -v /sys:/sys:ro \ + 100| jinghui1984/fnmon:latest + 101|``` + 102| + 103|启动后浏览器访问:**http://飞牛IP:5000** + 104| + 105|### 方式二:Docker Compose + 106| + 107|创建 `docker-compose.yml`: + 108| + 109|```yaml + 110|version: '3' + 111|services: + 112| fnmon: + 113| image: jinghui1984/fnmon:latest + 114| container_name: fnmon + 115| restart: always + 116| ports: + 117| - "5000:5000" + 118| privileged: true + 119| volumes: + 120| - /proc:/proc:ro + 121| - /sys:/sys:ro + 122|``` + 123| + 124|运行: + 125|```bash + 126|docker compose up -d + 127|``` + 128| + 129|### 方式三:SSH 离线安装 + 130| + 131|下载 fpk + 脚本: + 132| + 133|| 文件 | 说明 | + 134||------|------| + 135|| `fnmon-v1.0.15.fpk` | fnOS 应用包(44KB) | + 136|| `install.sh` | 一键安装脚本 | + 137| + 138|```bash + 139|sudo bash install.sh + 140|``` + 141| + 142|--- + 143| + 144|## ⚙️ 技术架构 + 145| + 146|``` + 147|┌─────────────┐ ┌─────────────┐ ┌─────────────┐ + 148|│ Flask 后端 │────▶│ SQLite 存储 │────▶│ 前端 Dashboard │ + 149|│ (Python) │ │ (用量追踪) │ │ (HTML+JS) │ + 150|└──────┬──────┘ └─────────────┘ └─────────────┘ + 151| │ + 152| ├──▶ psutil / smartctl / /proc (系统数据采集) + 153| ├──▶ Docker API (容器流量) + 154| └──▶ SSE 推送 (实时刷新) + 155|``` + 156| + 157|--- + 158| + 159|## 📦 下载链接 + 160| + 161|| 资源 | 链接 / 位置 | + 162||------|------------| + 163|| Docker Hub | `jinghui1984/fnmon:latest` | + 164|| Docker Compose | 见上方 `docker-compose.yml` | + 165|| 离线 fpk | 评论区下载 | + 166| + 167|--- + 168| + 169|## 🔄 更新计划 + 170| + 171|- [x] CPU 频率 + 核心温度监控 + 172|- [x] 内存 / SWAP 趋势图 + 173|- [x] 网络流量 + 容器排行 + 174|- [x] 硬盘健康 (SMART / NVMe 寿命) + 175|- [x] 进程 CPU 排行 + 176|- [x] 应用用量排行(日/周/月/年) + 177|- [x] CPU 评测 + 对比 + 178|- [ ] 暗色/亮色主题切换 + 179|- [ ] 自定义端口配置 + 180|- [ ] 微信/邮件告警(CPU温度过高) + 181|- [ ] 多语言支持 + 182| + 183|--- + 184| + 185|## 💬 交流反馈 + 186| + 187|- 使用中遇到问题请在评论区留言 + 188|- 想加新功能请在这里提出建议 + 189|- GitHub:https://github.com/jinghui1984/fnmon + 190| + 191|**觉得好用的话记得回帖支持一下!** 🎉 + 192| \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e932f99 --- /dev/null +++ b/README.md @@ -0,0 +1,195 @@ +
+
+
+
+
+
+
+
+
+
+
+
+
| PID | +用户 | +CPU% | +内存% | +启动时间 | +进程 | +
|---|