mirror of
https://github.com/arch3rPro/1Panel-Appstore.git
synced 2026-04-15 00:17:12 +08:00
feat(glance-agent): 添加对官方agent的支持并更新文档
添加官方glance-agent的0.1.0和latest版本配置 保留原有custom版本配置 更新README说明版本差异和配置方法
This commit is contained in:
21
apps/glance-agent/0.1.0/data.yml
Normal file
21
apps/glance-agent/0.1.0/data.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
additionalProperties:
|
||||
formFields:
|
||||
- default: "27973"
|
||||
envKey: AGENT_PORT
|
||||
label:
|
||||
en: Agent-Port
|
||||
zh: Agent-端口
|
||||
required: true
|
||||
type: number
|
||||
edit: true
|
||||
rule: paramPort
|
||||
- default: your_auth_token_here
|
||||
envKey: AGENT_TOKEN
|
||||
label:
|
||||
en: Agent-Token
|
||||
zh: Agent-Token
|
||||
required: false
|
||||
type: text
|
||||
edit: true
|
||||
random: true
|
||||
values: []
|
||||
17
apps/glance-agent/0.1.0/docker-compose.yml
Normal file
17
apps/glance-agent/0.1.0/docker-compose.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
glance-agent:
|
||||
container_name: ${CONTAINER_NAME}
|
||||
image: glanceapp/agent:v0.1.0
|
||||
environment:
|
||||
TOKEN: ${AGENT_TOKEN}
|
||||
volumes:
|
||||
- /storage:/storage:ro
|
||||
ports:
|
||||
- ${AGENT_PORT}:27973
|
||||
networks:
|
||||
- 1panel-network
|
||||
labels:
|
||||
createdBy: Apps
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
@@ -1,8 +1,20 @@
|
||||
# Glance Python 远程服务器监控 Agent
|
||||
# Glance 远程服务器监控 Agent
|
||||
|
||||
## 项目简介
|
||||
本项目为 Glance Dashboard 提供远程服务器监控数据采集,使用 Python3 + FastAPI 实现,兼容 Glance `server-stats` 组件前端展示。支持 Docker 部署,适合多服务器统一监控。
|
||||
|
||||
## 更新说明
|
||||
|
||||
Glance官方已经发布了agent,项目地址:[glance-agent](https://github.com/glanceapp/agent)
|
||||
本次更新后,保留本人使用 Python3 + FastAPI 实现的版本,同时新增了对 Glance 官方 agent 的支持。
|
||||
因为原生支持官方的agent,所以更推荐使用官方版本
|
||||
|
||||
## 版本说明
|
||||
|
||||
- 0.1.0 官方稳定版本 推荐
|
||||
- latest 官方最新版本
|
||||
- custom 作者自己写的版本 项目保留
|
||||
|
||||
## 功能特性
|
||||
- 采集主机名、平台、启动时间、CPU 负载/温度、内存、磁盘等信息
|
||||
- 提供 `/api/sysinfo/all` HTTP API,返回 Glance 兼容 JSON
|
||||
@@ -10,6 +22,18 @@
|
||||
- 可多实例部署,适配多服务器场景
|
||||
- **主机名自动识别**:容器内自动优先读取宿主机 `/etc/hostname`,无需手动配置
|
||||
|
||||
## 配置方法
|
||||
|
||||
在配置文件中添加以下内容:
|
||||
|
||||
- type: server-stats
|
||||
servers:
|
||||
- type: remote
|
||||
name: Custom Server Name
|
||||
url: http://<server IP or domain>:27973
|
||||
token: <token from above, if set>
|
||||
|
||||
|
||||
## API 说明
|
||||
- 路径:`/api/sysinfo/all`
|
||||
- 方法:GET
|
||||
@@ -212,5 +236,6 @@
|
||||
```
|
||||
|
||||
## 参考
|
||||
- [Glance-Agent](https://github.com/glanceapp/agent)
|
||||
- [Glance-Monitor](https://github.com/arch3rPro/Glance-Monitor)
|
||||
- [Document文档](https://github.com/arch3rPro/Glance-Monitor/blob/main/server-status-agent/README.md)
|
||||
|
||||
10
apps/glance-agent/custom/data.yml
Normal file
10
apps/glance-agent/custom/data.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
additionalProperties:
|
||||
formFields:
|
||||
- default: "12080"
|
||||
edit: true
|
||||
envKey: PANEL_APP_PORT_HTTP
|
||||
labelEn: Service Port 8000
|
||||
labelZh: 服务端口 8000
|
||||
required: true
|
||||
rule: paramPort
|
||||
type: number
|
||||
18
apps/glance-agent/custom/docker-compose.yml
Normal file
18
apps/glance-agent/custom/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
services:
|
||||
agent-image:
|
||||
image: vuldocker/glance-agent:latest
|
||||
container_name: ${CONTAINER_NAME}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${PANEL_APP_PORT_HTTP}:8000
|
||||
volumes:
|
||||
- /etc/hostname:/host/etc/hostname:ro
|
||||
networks:
|
||||
- 1panel-network
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
labels:
|
||||
createdBy: Apps
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
@@ -1,10 +1,21 @@
|
||||
additionalProperties:
|
||||
formFields:
|
||||
- default: "12080"
|
||||
edit: true
|
||||
envKey: PANEL_APP_PORT_HTTP
|
||||
labelEn: Service Port 8000
|
||||
labelZh: 服务端口 8000
|
||||
required: true
|
||||
rule: paramPort
|
||||
type: number
|
||||
formFields:
|
||||
- default: "27973"
|
||||
envKey: AGENT_PORT
|
||||
label:
|
||||
en: Agent-Port
|
||||
zh: Agent-端口
|
||||
required: true
|
||||
type: number
|
||||
edit: true
|
||||
rule: paramPort
|
||||
- default: your_auth_token_here
|
||||
envKey: AGENT_TOKEN
|
||||
label:
|
||||
en: Agent-Token
|
||||
zh: Agent-Token
|
||||
required: false
|
||||
type: text
|
||||
edit: true
|
||||
random: true
|
||||
values: []
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
services:
|
||||
agent-image:
|
||||
image: vuldocker/glance-agent:latest
|
||||
container_name: ${CONTAINER_NAME}
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- ${PANEL_APP_PORT_HTTP}:8000
|
||||
volumes:
|
||||
- /etc/hostname:/host/etc/hostname:ro
|
||||
networks:
|
||||
- 1panel-network
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
labels:
|
||||
createdBy: Apps
|
||||
glance-agent:
|
||||
container_name: ${CONTAINER_NAME}
|
||||
image: glanceapp/agent:latest
|
||||
environment:
|
||||
TOKEN: ${AGENT_TOKEN}
|
||||
volumes:
|
||||
- /storage:/storage:ro
|
||||
ports:
|
||||
- ${AGENT_PORT}:27973
|
||||
networks:
|
||||
- 1panel-network
|
||||
labels:
|
||||
createdBy: Apps
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
1panel-network:
|
||||
external: true
|
||||
|
||||
Reference in New Issue
Block a user