# server-monitor **Repository Path**: leke_code/server-monitor ## Basic Information - **Project Name**: server-monitor - **Description**: 智能运维助手 dify+ 企业微信 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-04-24 - **Last Updated**: 2026-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 服务器监控 API 服务 为 Dify 工作流提供服务器监控能力的 REST API 服务。 ## 安装依赖 ```bash cd server-monitor-api pip install -r requirements.txt ``` ## 启动服务 ```bash python main.py ``` 服务将在 http://localhost:8000 启动 ## API 接口文档 启动后访问:http://localhost:8000/docs ## 可用接口 | 接口 | 方法 | 说明 | |------|------|------| | `/` | GET | 服务状态 | | `/servers` | GET | 列出所有服务器 | | `/check/{alias}` | GET | 检查指定服务器状态 | | `/check-all` | GET | 检查所有服务器 | | `/services/{alias}` | GET | 查看服务状态 | | `/logs/{alias}/{service}` | GET | 查看服务日志 | | `/docker-ps/{alias}` | GET | 查看 Docker 容器 | | `/verify/{alias}` | GET | 验证服务器连接 | ## Dify 配置 1. 在 Dify 中添加「自定义工具」 2. 填写 OpenAPI Schema(可从 /docs 获取) 3. 配置 API 地址:http://localhost:8000 4. 在工作流中调用 ## 示例 ```bash # 列出服务器 curl http://localhost:8000/servers # 检查惠融平台 curl http://localhost:8000/check/惠融平台 # 查看 Java 日志 curl http://localhost:8000/logs/惠融平台/java?lines=50 ```