Skip to content

Commit b122fa3

Browse files
committed
Update.
1 parent 1ae94eb commit b122fa3

File tree

3 files changed

+180
-3
lines changed

3 files changed

+180
-3
lines changed

resource/template/component/server.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<label>{{tr "LinuxOneKeyInstall"}}</label>
5454
<div class="ui message">
5555
{{if .Conf.GRPCHost}}
56-
curl -L https://gitee.com/ten/ServerStatus/raw/master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh && ./server-status.sh install_agent <code class="command">{{.Conf.GRPCHost}}</code> <code
56+
curl -L https://gitee.com/ten/ServerStatus/raw/master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh && sudo ./server-status.sh install_agent <code class="command">{{.Conf.GRPCHost}}</code> <code
5757
class="command">{{if .Conf.ProxyGRPCPort}}{{.Conf.ProxyGRPCPort}}{{else}}{{.Conf.GRPCPort}}{{end}}</code> <code
5858
class="command hostSecret"></code> <code class="command">{{if .Conf.TLS}}--tls{{end}}</code>
5959
{{else}}
@@ -69,4 +69,4 @@
6969
</button>
7070
</div>
7171
</div>
72-
{{end}}
72+
{{end}}

resource/template/dashboard-default/server.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</td>
5858
<td>
5959
<div class="ui mini icon buttons">
60-
<button class="ui icon mini button" data-clipboard-text="{{if $.Conf.GRPCHost}}curl -L https://gitee.com/ten/ServerStatus/raw/master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh && ./server-status.sh install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}" data-tooltip="{{tr "ClickToCopy"}}">
60+
<button class="ui icon mini button" data-clipboard-text="{{if $.Conf.GRPCHost}}curl -L https://gitee.com/ten/ServerStatus/raw/master/script/server-status.sh -o server-status.sh && chmod +x server-status.sh && sudo ./server-status.sh install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}" data-tooltip="{{tr "ClickToCopy"}}">
6161
<i class="linux icon"></i>
6262
</button>
6363
<button class="ui icon mini button" data-clipboard-text="{{if $.Conf.GRPCHost}}[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12;set-ExecutionPolicy RemoteSigned;Invoke-WebRequest https://fastly.jsdelivr.net/gh/xos/serverstatus@master/script/server-status.ps1 -OutFile C:\server-status.ps1;powershell.exe C:\server-status.ps1 {{$.Conf.GRPCHost}}:{{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}" data-tooltip="{{tr "ClickToCopy"}}">

script/config.yml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# ServerAgent 配置文件
2+
# 此配置文件用于自定义 Agent 的所有运行参数
3+
# 配置文件中的设置可以被命令行参数覆盖
4+
5+
# ==================== 监控配置 ====================
6+
7+
# 硬盘分区白名单 - 指定要监控的硬盘分区挂载点
8+
# 如果为空,则监控所有分区
9+
# 示例:
10+
# harddrivePartitionAllowlist:
11+
# - "/"
12+
# - "/home"
13+
# - "/var"
14+
harddrivePartitionAllowlist: []
15+
16+
# 网卡白名单 - 指定要监控的网络接口
17+
# 如果为空,则监控所有网卡
18+
# 示例:
19+
# nicAllowlist:
20+
# eth0: true
21+
# wlan0: true
22+
# lo: false
23+
nicAllowlist: {}
24+
25+
# 自定义 DNS 服务器列表
26+
# 如果为空,则使用默认的 DNS 服务器
27+
# 默认 DNS 服务器包括:
28+
# IPv4: 8.8.4.4:53, 223.5.5.5:53, 94.140.14.140:53, 119.29.29.29:53
29+
# IPv6: [2001:4860:4860::8844]:53, [2400:3200::1]:53, [2a10:50c0::1:ff]:53, [2402:4e00::]:53
30+
# 示例:
31+
# dns:
32+
# - "1.1.1.1:53"
33+
# - "1.0.0.1:53"
34+
# - "8.8.8.8:53"
35+
# - "8.8.4.4:53"
36+
dns: []
37+
38+
# GPU 监控开关
39+
# 设置为 true 启用 GPU 监控,false 禁用
40+
# 注意:启用 GPU 监控可能需要额外的系统权限和驱动支持
41+
gpu: true
42+
43+
# 温度监控开关
44+
# 设置为 true 启用温度监控,false 禁用
45+
# 注意:温度监控可能需要额外的系统权限和硬件支持
46+
temperature: true
47+
48+
# 调试模式开关
49+
# 设置为 true 启用调试日志输出,false 禁用
50+
# 调试模式会输出更详细的运行信息,有助于问题排查
51+
debug: true
52+
53+
# ==================== 连接配置 ====================
54+
55+
# 服务器地址 - 管理面板的 RPC 端口
56+
# 格式:主机名:端口 或 IP:端口
57+
server: "grpc.nange.cn:443"
58+
59+
# 客户端密钥 - Agent 连接到服务器的认证密钥
60+
# 这是必需的参数,如果为空程序将退出
61+
clientSecret: "MD3Msdfh0S58h67sk"
62+
63+
# TLS 加密 - 是否启用 SSL/TLS 加密传输
64+
# 设置为 true 启用加密传输,false 使用明文传输
65+
tls: true
66+
67+
# 不安全的 TLS - 是否禁用证书检查
68+
# 设置为 true 时将跳过 TLS 证书验证(不推荐在生产环境使用)
69+
insecureTLS: false
70+
71+
# ==================== 功能开关 ====================
72+
73+
# 跳过连接数检查 - 是否禁用网络连接数监控
74+
# 设置为 true 将不监控 TCP/UDP 连接数
75+
skipConnectionCount: false
76+
77+
# 跳过进程数检查 - 是否禁用进程数量监控
78+
# 设置为 true 将不监控系统进程数量
79+
skipProcsCount: false
80+
81+
# 禁用自动更新 - 是否禁用自动升级功能
82+
# 设置为 true 将禁用定时检查和自动更新
83+
disableAutoUpdate: false
84+
85+
# 禁用强制更新 - 是否禁用服务器强制升级
86+
# 设置为 true 将忽略服务器发送的强制更新指令
87+
disableForceUpdate: false
88+
89+
# 禁用命令执行 - 是否禁止在此机器上执行命令
90+
# 设置为 true 将禁用远程命令执行、终端和文件管理功能
91+
disableCommandExecute: false
92+
93+
# 禁用内网穿透 - 是否禁止此机器的内网穿透功能
94+
# 设置为 true 将禁用 NAT 穿透功能
95+
disableNat: false
96+
97+
# 禁用发送查询 - 是否禁止此机器发送网络请求
98+
# 设置为 true 将禁用 TCP/ICMP/HTTP 请求功能
99+
disableSendQuery: false
100+
101+
# ==================== 其他配置 ====================
102+
103+
# 报告间隔 - 系统状态上报间隔(秒)
104+
# 取值范围:1-4 秒,建议使用 1 秒以获得最佳监控精度
105+
reportDelay: 1
106+
107+
# IP 上报周期 - 本地 IP 更新间隔(秒)
108+
# 默认 30 分钟(1800 秒),上报频率依旧取决于 reportDelay 的值
109+
ipReportPeriod: 1800
110+
111+
# 使用 IPv6 国家代码 - 是否优先展示 IPv6 位置信息
112+
# 设置为 true 将优先使用 IPv6 地址进行地理位置查询
113+
useIPv6CountryCode: false
114+
115+
# 使用 Gitee 更新 - 是否强制从 Gitee 获取更新
116+
# 设置为 true 将从 Gitee 而不是 GitHub 获取更新(适用于中国大陆用户)
117+
useGiteeToUpgrade: false
118+
119+
# ==================== 配置说明 ====================
120+
121+
# 1. 配置文件优先级:
122+
# - 命令行参数 > 配置文件 > 默认值
123+
# - 可以在配置文件中设置常用参数,临时使用命令行参数覆盖
124+
#
125+
# 2. 必需参数:
126+
# - clientSecret: 必须设置,否则程序无法启动
127+
#
128+
# 3. 监控配置:
129+
# - harddrivePartitionAllowlist: 指定要监控的分区挂载点
130+
# - nicAllowlist: 指定要监控的网络接口
131+
# - dns: 自定义 DNS 服务器,支持 IPv4 和 IPv6
132+
# - gpu: 启用 GPU 监控(需要驱动支持)
133+
# - temperature: 启用温度监控(需要硬件支持)
134+
#
135+
# 4. 连接配置:
136+
# - server: 服务器地址,格式为 "主机:端口"
137+
# - tls: 启用 TLS 加密传输
138+
# - insecureTLS: 跳过证书验证(仅用于测试)
139+
#
140+
# 5. 功能开关:
141+
# - 各种 disable* 选项可以禁用特定功能
142+
# - skip* 选项可以跳过特定的监控项目
143+
#
144+
# 6. 性能配置:
145+
# - reportDelay: 影响监控精度和网络流量
146+
# - ipReportPeriod: 影响 IP 地址更新频率
147+
#
148+
# 7. 配置修改:
149+
# - 修改配置文件后需要重启 Agent 才能生效
150+
# - 可以使用 `agent edit` 命令进行交互式配置
151+
152+
# ==================== 示例配置 ====================
153+
154+
# 生产环境示例配置:
155+
# server: "monitor.example.com:2222"
156+
# clientSecret: "your-secret-key-here"
157+
# tls: true
158+
# insecureTLS: false
159+
# debug: false
160+
# reportDelay: 1
161+
# disableCommandExecute: true # 生产环境建议禁用命令执行
162+
# disableNat: true # 生产环境建议禁用内网穿透
163+
164+
# 开发环境示例配置:
165+
# server: "localhost:2222"
166+
# clientSecret: "dev-secret"
167+
# tls: false
168+
# debug: true
169+
# gpu: true
170+
# temperature: true
171+
172+
# 中国大陆用户示例配置:
173+
# useGiteeToUpgrade: true
174+
# dns:
175+
# - "223.5.5.5:53" # 阿里 DNS
176+
# - "119.29.29.29:53" # 腾讯 DNS
177+
# - "114.114.114.114:53" # 114 DNS

0 commit comments

Comments
 (0)