nezhahq.github.io/assets/guide_q7.md.BLmx2e60.js
2024-07-12 02:27:25 +00:00

2 lines
3.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,c as a,o as t,a4 as s}from"./chunks/framework.BmdFiWrL.js";const _=JSON.parse('{"title":"自定义 Agent 监控项目","description":"","frontmatter":{},"headers":[],"relativePath":"guide/q7.md","filePath":"guide/q7.md","lastUpdated":1720751193000}'),i={name:"guide/q7.md"},n=s('<h1 id="自定义-agent-监控项目" tabindex="-1">自定义 Agent 监控项目 <a class="header-anchor" href="#自定义-agent-监控项目" aria-label="Permalink to &quot;自定义 Agent 监控项目&quot;"></a></h1><h2 id="自定义监控的网卡和硬盘分区" tabindex="-1">自定义监控的网卡和硬盘分区 <a class="header-anchor" href="#自定义监控的网卡和硬盘分区" aria-label="Permalink to &quot;自定义监控的网卡和硬盘分区&quot;"></a></h2><p>执行以下命令来选择自定义的网卡和分区,然后重启 Agent 即可生效:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">/opt/nezha/agent/nezha-agent</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> edit</span></span></code></pre></div><h2 id="其他运行参数" tabindex="-1">其他运行参数 <a class="header-anchor" href="#其他运行参数" aria-label="Permalink to &quot;其他运行参数&quot;"></a></h2><p>通过执行以下命令查看支持的参数:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./nezha-agent</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --help</span></span></code></pre></div><p>如果你使用了一键脚本安装 Agent可以编辑 <code>/etc/systemd/system/nezha-agent.service</code>,在 <code>ExecStart=</code> 这一行的末尾加上以下参数:</p><ul><li><code>--report-delay</code>:控制系统信息上报的间隔,默认为 1 秒,可以设置为 3 来进一步降低 agent 端系统资源占用(配置区间 1-4。</li><li><code>--skip-conn</code>:不监控连接数,推荐在机场/连接密集型服务器或CPU占用较高的服务器上设置。</li><li><code>--skip-procs</code>:不监控进程数,也可以降低 Agent 占用。</li><li><code>--disable-auto-update</code>:禁止 <strong>自动更新</strong> Agent安全特性。</li><li><code>--disable-force-update</code>:禁止 <strong>强制更新</strong> Agent安全特性。</li><li><code>--disable-command-execute</code>:禁止在 Agent 上执行定时任务、打开在线终端(安全特性)。</li><li><code>--tls</code>:启用 SSL/TLS 加密(使用 nginx 反向代理 Agent 的 grpc 连接,并且 nginx 开启 SSL/TLS 时,需要启用该项配置)。</li><li><code>--gpu</code>: 启用 GPU 监控(其中 GPU 使用率监控可能需要安装额外依赖。相关问题请参见常见问题 - 启用 GPU 监控。)</li></ul>',9),o=[n];function d(l,c,p,h,r,g){return t(),a("div",null,o)}const k=e(i,[["render",d]]);export{_ as __pageData,k as default};