# ECN-monit **Repository Path**: zxfLoveWd/ecn-monit ## Basic Information - **Project Name**: ECN-monit - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-11 - **Last Updated**: 2026-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ECN监控系统 实时监控网络接口的ECN(Explicit Congestion Notification)标记率。 ## 功能特性 - 实时采集ECN数据 - 可视化折线图展示 - 多服务器、多接口支持 - 自动数据清理 - 响应式Web界面 ## 安装 ```bash pip install -r requirements.txt ``` ## 配置 编辑 `config.json` 文件: ```json { "interval": 10, "retention_days": 7, "servers": { "server1": { "host": "服务器IP", "port": 22, "user": "root", "password": "密码", "command_path": "/log/watch_ecn", "interfaces": ["twenty-fivegige0_54"] } } } ``` ## 使用 ### 启动Web服务 ```bash python app.py ``` 访问 http://localhost:8080 ### 启动采集器 ```bash python collector.py ``` ### 推荐:一键启动(Windows) 在 Windows 下可以使用一键脚本启动(同进程模式,支持内存推送 SSE): ```bat run.bat ``` 脚本会优先运行 `run_inprocess.py`(在同一进程中以后台线程运行采集器并启动 Flask),并自动在浏览器打开监控页面。如果未检测到 `run_inprocess.py`,脚本会回退到 `start.py`(分别启动采集器和 Web 服务)。 ## 目录结构 ``` ecn-monitor/ ├── app.py # Web服务 ├── collector.py # 数据采集器 ├── config.json # 配置文件 ├── requirements.txt # 依赖列表 ├── ecn.db # 数据库文件(自动生成) ├── templates/ │ ├── index.html # 主页 │ └── ecn.html # ECN监控页面 └── static/ ├── css/ │ └── index.css # 样式文件 └── js/ ├── jquery-3.7.1.min.js # jQuery库 ├── plotly-3.3.1.min.js # 图表库 ├── index.js # 主页脚本 └── ecn.js # ECN页面脚本 ``` ## 注意事项 需要将 `static/js/jquery-3.7.1.min.js` 和 `static/js/plotly-3.3.1.min.js` 从原项目复制过来。