This commit is contained in:
cantoblanco committed 2024-07-12 02:27:25 +00:00
1 parent 6be2265eef
commit 3db89eb60d
189 files changed
+331 -331

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
<link rel="modulepreload" href="/assets/chunks/framework.BmdFiWrL.js">
<link rel="modulepreload" href="/assets/chunks/theme.D1TJKLdg.js">
<link rel="modulepreload" href="/assets/guide_notifications.md.BTKbStwu.lean.js">
<link rel="modulepreload" href="/assets/guide_notifications.md.CTC0F9KO.lean.js">
<script src="https://cdn.wwads.cn/js/makemoney.js" async></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-FDME8GJGTW"></script>
<script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","G-FDME8GJGTW");</script>
@@ -49,8 +49,8 @@
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;markdown&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> &quot;content&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;# 哪吒通知消息</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\n\n\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#NEZHA#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 名称: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.NAME#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; IP: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.IP#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; IPv4: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.IPV4#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; IPv6: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.IPV6#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; CPU: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.CPU#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 内存: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.MEM#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 交换分区: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.SWAP#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 存储: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.DISK#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 实时上传速度: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.NETINSPEED#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 实时下载速度: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.NETOUTSPEED#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 总上传: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.TRANSFERIN#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 总下载: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.TRANSFEROUT#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 1分钟内负载: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.LOAD1#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 5分钟内负载: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#SERVER.LOAD5#</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;\n</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&gt; 15分钟内负载: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\&quot;</span><span style="--shiki-light:#032F62;--shiki-dark:Line truncated
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></li></ul><p>根据需求删减相关内容信息即可。</p><p><img src="https://user-images.githubusercontent.com/30169860/223605620-eac53ee6-09f9-4583-94fa-9b0cdedba81c.png" alt="通知效果"></p></details><h3 id="飞书群机器人配置-示例-贡献者-eya46" tabindex="-1">飞书群机器人配置 示例 贡献者:<a href="https://github.com/eya46" target="_blank" rel="noreferrer">@eya46</a> <a class="header-anchor" href="#飞书群机器人配置-示例-贡献者-eya46" aria-label="Permalink to &quot;飞书群机器人配置 示例 贡献者:[@eya46](https://github.com/eya46)&quot;">​</a></h3><details><summary>点击展开/收起</summary><h4 id="url-参数获取说明-4" tabindex="-1">URL 参数获取说明 <a class="header-anchor" href="#url-参数获取说明-4" aria-label="Permalink to &quot;URL 参数获取说明&quot;">​</a></h4><p>机器人 URL 通过飞书群 - 群机器人 - 添加机器人 - 自定义机器人(webhook)创建后获取。</p><ul><li>名称: 哪吒面板 Bot</li><li>URL:<a href="https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx" target="_blank" rel="noreferrer">https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx</a></li><li>请求方式: POST</li><li>请求类型: JSON</li><li>Body: <code>{&quot;content&quot;:{&quot;text&quot;:&quot;#NEZHA#\n#DATETIME#&quot;},&quot;msg_type&quot;:&quot;text&quot;}</code></li></ul></details><h2 id="告警规则说明" tabindex="-1">告警规则说明 <a class="header-anchor" href="#告警规则说明" aria-label="Permalink to &quot;告警规则说明&quot;">​</a></h2><h3 id="基本规则" tabindex="-1">基本规则 <a class="header-anchor" href="#基本规则" aria-label="Permalink to &quot;基本规则&quot;">​</a></h3><ul><li><code>type</code>:可选取一个或多个类型,如在一个规则中选择了多个类型,需要<strong>同时满足</strong>所有选择的类型才会触发通知(可参考后面的示例) <ul><li><code>cpu</code>、<code>gpu</code>、<code>memory</code>、<code>swap</code>、<code>disk</code></li><li><code>net_in_speed</code> 入站网速、<code>net_out_speed</code> 出站网速、<code>net_all_speed</code> 双向网速、<code>transfer_in</code> 入站流量、<code>transfer_out</code> 出站流量、<code>transfer_all</code> 双向流量</li><li><code>offline</code> 离线监控</li><li><code>load1</code>、<code>load5</code>、<code>load15</code> 负载</li><li><code>process_count</code> 进程数(目前取线程数占用资源太多,暂时不支持)</li><li><code>tcp_conn_count</code>、<code>udp_conn_count</code> 连接数</li><li><code>temperature_max</code> 最高温度值</li></ul></li><li><code>duration</code>:持续数秒,数秒内采样记录 30% 以上触发阈值才会告警(防数据插针)</li><li><code>min</code> 或 <code>max</code>: <ul><li>流量、网速类单位为字节(1KB=1024B,1MB=1024*1024B)</li><li>内存、硬盘、CPU 以占用百分比计数</li><li>离线监控无需设置此项</li></ul></li><li><code>cover</code>: <ul><li><code>0</code> 监控所有服务器,通过 <code>ignore</code> 忽略特定服务器</li><li><code>1</code> 忽略所有服务器,通过 <code>ignore</code> 监控特定服务器<br> 例如:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:10, &quot;cover&quot;:0, &quot;ignore&quot;:{&quot;5&quot;: true}}]</code></li></ul></li><li><code>ignore</code>:选择忽略特定服务器,搭配 <code>cover</code> 使用,内容为服务器 ID 和布尔值,例如:<code>{&quot;1&quot;: true, &quot;2&quot;: false}</code></li></ul><p><strong>完整示例:</strong></p><p>添加一个离线告警:</p><ul><li>名称:离线通知</li><li>规则:<code>[{&quot;Type&quot;:&quot;offline&quot;,&quot;Duration&quot;:10}]</code></li><li>启用:√</li></ul><p>添加一个监控 CPU 持续 10 秒超过 50% <strong>且</strong> 内存持续 20 秒占用低于 20% 的告警:</p><ul><li>名称:CPU+内存</li><li>规则:<code>[{&quot;Type&quot;:&quot;cpu&quot;,&quot;Min&quot;:0,&quot;Max&quot;:50,&quot;Duration&quot;:10},{&quot;Type&quot;:&quot;memory&quot;,&quot;Min&quot;:20,&quot;Max&quot;:0,&quot;Duration&quot;:20}]</code></li><li>启用:√</li></ul><p>将特定的服务器通知发送到特定的通知分组:</p><p>示例场景:<br> 有 1、2、3、4 四台服务器和 A、B 两个不同的通知组。<br> 1、2 这两台服务器掉线十分钟后给通知组 A 发送通知。<br> 3、4 这两台服务器掉线十分钟后给通知组 B 发送通知。</p><p>首先你需要先设置好 A、B 两个通知组,然后添加两条告警规则:</p><p><strong>规则一:</strong></p><ul><li>名称:1、2 离线,发送给通知组 A</li><li>规则:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:600,&quot;cover&quot;:1,&quot;ignore&quot;Line truncated
<script>window.__VP_HASH_MAP__=JSON.parse("{\"case_case4.md\":\"CqC5jqQR\",\"en_us_case_case4.md\":\"CY813vwD\",\"en_us_guide_q4.md\":\"Bd94AXi_\",\"en_us_guide_notifications.md\":\"D0_FkA5m\",\"en_us_developer_theme.md\":\"BEdolcs4\",\"en_us_case_case3.md\":\"B3b1J7xZ\",\"en_us_case_index.md\":\"COaxoaQg\",\"guide_notifications.md\":\"BTKbStwu\",\"guide_q2.md\":\"B-n6iRZa\",\"case_case5.md\":\"B7tVj5xz\",\"en_us_case_case5.md\":\"DKiNqBjQ\",\"en_us_case_case2.md\":\"DwHrN6YE\",\"en_us_guide_tasks.md\":\"061qeF1Q\",\"en_us_case_case1.md\":\"DtobiFhJ\",\"en_us_index.md\":\"D3Q7k9d5\",\"en_us_guide_settings.md\":\"BndaEvAP\",\"developer_theme.md\":\"BCgZy7F0\",\"guide_q6.md\":\"Bl23W_Yf\",\"case_case1.md\":\"BciV-ie3\",\"en_us_guide_q2.md\":\"DngIRNmt\",\"guide_q7.md\":\"D0AcfSZ4\",\"en_us_guide_q9.md\":\"8B8UwY7d\",\"guide_q5.md\":\"hSzLXcX4\",\"guide_q9.md\":\"_sXmvo81\",\"en_us_guide_servers.md\":\"qocuhp9n\",\"en_us_guide_q3.md\":\"CyIhnshG\",\"guide_servers.md\":\"DSRNfDRJ\",\"guide_services.md\":\"DhIr57E0\",\"en_us_guide_q6.md\":\"Cuk0jOmM\",\"en_us_guide_q5.md\":\"DcxXcXCd\",\"en_us_guide_q7.md\":\"B2C5079q\",\"en_us_guide_q8.md\":\"l7mgmAoJ\",\"en_us_guide_dashboardq.md\":\"BWzJHopo\",\"en_us_guide_services.md\":\"DQ3Ia23y\",\"guide_dashboard.md\":\"Dro79qfN\",\"guide_dashboardq.md\":\"Bm75ElBX\",\"guide_loginq.md\":\"C4Zghl85\",\"en_us_developer_index.md\":\"zEyT5StA\",\"guide_q8.md\":\"cadn1l58\",\"developer_l10n.md\":\"DzZQ9vhp\",\"case_case3.md\":\"CLDh-EHU\",\"developer_index.md\":\"qosjxGDF\",\"case_index.md\":\"DH_cANDo\",\"case_case2.md\":\"hphOxTiw\",\"guide_agent.md\":\"euS4OBJY\",\"guide_q4.md\":\"CJPeNFDu\",\"guide_q1.md\":\"BsrZbadc\",\"guide_agentq.md\":\"Kz_HJTRB\",\"en_us_guide_loginq.md\":\"gM_Vw3rO\",\"guide_q3.md\":\"B5jmhPOq\",\"en_us_guide_agentq.md\":\"JST9rKpw\",\"en_us_guide_api.md\":\"CfM96va1\",\"en_us_guide_agent.md\":\"-JuNIYt-\",\"guide_settings.md\":\"BPx6x8ZO\",\"guide_api.md\":\"wcJE8Os-\",\"index.md\":\"C0rgjGat\",\"en_us_guide_dashboard.md\":\"BXoxN8Px\",\"guide_tasks.md\":\"CJJzCBwF\",\"en_us_developer_l10n.md\":\"C_Ujnyqb\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"VitePress\",\"description\":\"A VitePress site\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":{\"src\":\"/logo.png\",\"width\":24,\"height\":24,\"alt\":\"NezhaLogo\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/nezhahq/nezhahq.github.io\"},{\"icon\":{\"svg\":\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 496 512\\\"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d=\\\"M248 8C111 8 0 119 0 256S111 504 248 504 496 393 496 256 385 8 248 8zM363 176.7c-3.7 39.2-19.9 134.4-28.1 178.3-3.5 18.6-10.3 24.8-16.9 25.4-14.4 1.3-25.3-9.5-39.3-18.7-21.8-14.3-34.2-23.2-55.3-37.2-24.5-16.1-8.6-25 5.3-39.5 3.7-3.8 67.1-61.5 68.3-66.7 .2-.7 .3-3.1-1.2-4.4s-3.6-.8-5.1-.5q-3.3 .7-104.6 69.1-14.8 10.2-26.9 9.9c-8.9-.2-25.9-5-38.6-9.1-15.5-5-27.9-7.7-26.8-16.3q.8-6.7 18.5-13.7 108.4-47.2 144.6-62.3c68.9-28.6 83.2-33.6 92.5-33.8 2.1 0 6.6 .5 9.6 2.9a10.5 10.5 0 0 1 3.5 6.7A43.8 43.8 0 0 1 363 176.7z\\\"/></svg>\"},\"link\":\"https://t.me/nezhanews\"}],\"search\":{\"provider\":\"algolia\",\"options\":{\"appId\":\"HP6QF6KMZD\",\"apiKey\":\"fb8bae9ed373d1057e0c07fcf32b3f1a\",\"indexName\":\"nezhahq\",\"locales\":{\"root\":{\"placeholder\":\"搜索文档\",\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"searchBox\":{\"resetButtonTitle\":\"清除查询条件\",\"resetButtonAriaLabel\":\"清除查询条件\",\"cancelButtonText\":\"取消\",\"cancelButtonAriaLabel\":\"取消\"},\"startScreen\":{\"recentSearchesTitle\":\"搜索历史\",\"noRecentSearchesText\":\"没有搜索历史\",\"saveRecentSearchButtonTitle\":\"保存至搜索历史\",\"removeRecentSearchButtonTitle\":\"从搜索历史中移除\",\"favoriteSearchesTitle\":\"收藏\",\"removeFavoriteSearchButtonTitle\":\"从收藏中移除\"},\"errorScreen\":{\"titleText\":\"无法获取结果\",\"helpText\":\"你可能需要检查你的网络连接\"},\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\",\"searchByText\":\"搜索提供者\"},\"noResultsScreen\":{\"noResultsText\":\"无法找到相关结果\",\"suggestedQueryText\":\"你可以尝试查询\",\"reportMissingResultsText\":\"你认为该查询应该有结果?\",\"reportMissingResultsLinkText\":\"点击反馈\"}}}}}}},\"footer\":{\"message\":\"This work is licensed under a <a rel=\\\"license\\\" href=\\\"http://creativecommons.org/licenses/by-nc-sa/4.0/\\\">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License\",\"copyright\":\"Copyright © 2022-present NezhaHQ\"}},\"locales\":{\"root\":{\"lang\":\"zh-CN\",\"label\Line truncated
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></li></ul><p>根据需求删减相关内容信息即可。</p><p><img src="https://user-images.githubusercontent.com/30169860/223605620-eac53ee6-09f9-4583-94fa-9b0cdedba81c.png" alt="通知效果"></p></details><h3 id="飞书群机器人配置-示例-贡献者-eya46" tabindex="-1">飞书群机器人配置 示例 贡献者:<a href="https://github.com/eya46" target="_blank" rel="noreferrer">@eya46</a> <a class="header-anchor" href="#飞书群机器人配置-示例-贡献者-eya46" aria-label="Permalink to &quot;飞书群机器人配置 示例 贡献者:[@eya46](https://github.com/eya46)&quot;">​</a></h3><details><summary>点击展开/收起</summary><h4 id="url-参数获取说明-4" tabindex="-1">URL 参数获取说明 <a class="header-anchor" href="#url-参数获取说明-4" aria-label="Permalink to &quot;URL 参数获取说明&quot;">​</a></h4><p>机器人 URL 通过飞书群 - 群机器人 - 添加机器人 - 自定义机器人(webhook)创建后获取。</p><ul><li>名称: 哪吒面板 Bot</li><li>URL:<a href="https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx" target="_blank" rel="noreferrer">https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx</a></li><li>请求方式: POST</li><li>请求类型: JSON</li><li>Body: <code>{&quot;content&quot;:{&quot;text&quot;:&quot;#NEZHA#\n#DATETIME#&quot;},&quot;msg_type&quot;:&quot;text&quot;}</code></li></ul></details><h2 id="告警规则说明" tabindex="-1">告警规则说明 <a class="header-anchor" href="#告警规则说明" aria-label="Permalink to &quot;告警规则说明&quot;">​</a></h2><h3 id="基本规则" tabindex="-1">基本规则 <a class="header-anchor" href="#基本规则" aria-label="Permalink to &quot;基本规则&quot;">​</a></h3><ul><li><code>type</code>:可选取一个或多个类型,如在一个规则中选择了多个类型,需要<strong>同时满足</strong>所有选择的类型才会触发通知(可参考后面的示例) <ul><li><code>cpu</code>、<code>gpu</code>、<code>memory</code>、<code>swap</code>、<code>disk</code></li><li><code>net_in_speed</code> 入站网速、<code>net_out_speed</code> 出站网速、<code>net_all_speed</code> 双向网速、<code>transfer_in</code> 入站流量、<code>transfer_out</code> 出站流量、<code>transfer_all</code> 双向流量</li><li><code>offline</code> 离线监控</li><li><code>load1</code>、<code>load5</code>、<code>load15</code> 负载</li><li><code>process_count</code> 进程数(目前取线程数占用资源太多,暂时不支持)</li><li><code>tcp_conn_count</code>、<code>udp_conn_count</code> 连接数</li><li><code>temperature_max</code> 最高温度值</li></ul></li><li><code>duration</code>:持续数秒,数秒内采样记录 30% 以上触发阈值才会告警(防数据插针)</li><li><code>min</code> 或 <code>max</code>: <ul><li>流量、网速类单位为字节(1KB=1024B,1MB=1024*1024B)</li><li>内存、硬盘、CPU 以占用百分比计数</li><li>离线监控无需设置此项</li></ul></li><li><code>cover</code>: <ul><li><code>0</code> 监控所有服务器,通过 <code>ignore</code> 忽略特定服务器</li><li><code>1</code> 忽略所有服务器,通过 <code>ignore</code> 监控特定服务器<br> 例如:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:10, &quot;cover&quot;:0, &quot;ignore&quot;:{&quot;5&quot;: true}}]</code></li></ul></li><li><code>ignore</code>:选择忽略特定服务器,搭配 <code>cover</code> 使用,内容为服务器 ID 和布尔值,例如:<code>{&quot;1&quot;: true, &quot;2&quot;: false}</code></li></ul><p><strong>完整示例:</strong></p><p>添加一个离线告警:</p><ul><li>名称:离线通知</li><li>规则:<code>[{&quot;Type&quot;:&quot;offline&quot;,&quot;Duration&quot;:10}]</code></li><li>启用:√</li></ul><p>添加一个监控 CPU 持续 10 秒超过 50% <strong>且</strong> 内存持续 20 秒占用低于 20% 的告警:</p><ul><li>名称:CPU+内存</li><li>规则:<code>[{&quot;Type&quot;:&quot;cpu&quot;,&quot;Min&quot;:0,&quot;Max&quot;:50,&quot;Duration&quot;:10},{&quot;Type&quot;:&quot;memory&quot;,&quot;Min&quot;:20,&quot;Max&quot;:0,&quot;Duration&quot;:20}]</code></li><li>启用:√</li></ul><p>将特定的服务器通知发送到特定的通知分组:</p><p>示例场景:<br> 有 1、2、3、4 四台服务器和 A、B 两个不同的通知组。<br> 1、2 这两台服务器掉线十分钟后给通知组 A 发送通知。<br> 3、4 这两台服务器掉线十分钟后给通知组 B 发送通知。</p><p>首先你需要先设置好 A、B 两个通知组,然后添加两条告警规则:</p><p><strong>规则一:</strong></p><ul><li>名称:1、2 离线,发送给通知组 A</li><li>规则:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:600,&quot;cover&quot;:1,&quot;ignore&quot;Line truncated
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_agentq.md\":\"DF4S-EGU\",\"en_us_guide_dashboardq.md\":\"D2QOaj6O\",\"en_us_developer_l10n.md\":\"DS0IAqQH\",\"case_case4.md\":\"DT8IO4B8\",\"en_us_guide_q2.md\":\"CiA_CaX3\",\"developer_index.md\":\"PDR6LcrC\",\"en_us_guide_q4.md\":\"Bl78D0QZ\",\"developer_theme.md\":\"W-StpYDg\",\"en_us_guide_q5.md\":\"yOhynKj5\",\"en_us_guide_q3.md\":\"C_mcMrtL\",\"en_us_guide_q6.md\":\"DdKQXIiY\",\"developer_l10n.md\":\"Het2UCFW\",\"en_us_guide_servers.md\":\"Ba6xM0_F\",\"en_us_case_case1.md\":\"BJ4EpiPm\",\"case_case2.md\":\"B7iwWjEJ\",\"en_us_case_case4.md\":\"CDEbS9uC\",\"en_us_developer_index.md\":\"Cbb6vzAe\",\"case_case1.md\":\"BtVA5IHi\",\"en_us_case_case5.md\":\"dHHUt8Pb\",\"en_us_guide_tasks.md\":\"BD-xN18f\",\"en_us_guide_q9.md\":\"D8Z3rTQ2\",\"guide_api.md\":\"Dpf5Jlta\",\"en_us_guide_agent.md\":\"Bv2yJX9f\",\"guide_agent.md\":\"BUu209hq\",\"en_us_guide_agentq.md\":\"BYnSNb9V\",\"guide_q7.md\":\"BLmx2e60\",\"case_case5.md\":\"CDloWXgc\",\"en_us_guide_notifications.md\":\"CADFHH2k\",\"en_us_case_case2.md\":\"CkK0CUip\",\"guide_servers.md\":\"D8N1KBkN\",\"guide_dashboard.md\":\"BTn6xNP8\",\"en_us_developer_theme.md\":\"Dwvm-TyZ\",\"guide_q9.md\":\"DD951keo\",\"en_us_index.md\":\"DK6sa18S\",\"en_us_guide_q8.md\":\"BSA4GUo3\",\"en_us_case_index.md\":\"B2Ny-vQ4\",\"en_us_guide_settings.md\":\"BNJ6rD4o\",\"guide_dashboardq.md\":\"BEzsHn-P\",\"case_index.md\":\"BrBN_3Ny\",\"en_us_guide_q7.md\":\"CGxbnwh9\",\"guide_loginq.md\":\"D_a6r0Pn\",\"case_case3.md\":\"B1ZNbO7R\",\"guide_notifications.md\":\"CTC0F9KO\",\"guide_q1.md\":\"B2i6c53k\",\"guide_settings.md\":\"xDPb5hJr\",\"guide_q8.md\":\"BM3zBWC4\",\"guide_q2.md\":\"rOP_4EDo\",\"guide_q3.md\":\"5ab9GLO1\",\"guide_q4.md\":\"BqynO8Dc\",\"en_us_guide_loginq.md\":\"rmuRXdss\",\"guide_q5.md\":\"DZhAjyeU\",\"guide_q6.md\":\"BVxW6CxM\",\"guide_services.md\":\"ZGhto53o\",\"en_us_case_case3.md\":\"COlSqgUu\",\"en_us_guide_dashboard.md\":\"BdqEdgLT\",\"en_us_guide_services.md\":\"rT2X4U9k\",\"en_us_guide_api.md\":\"Dp6CHW_f\",\"guide_tasks.md\":\"B_vEYmKa\",\"index.md\":\"CSczgdfe\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"zh-CN\",\"dir\":\"ltr\",\"title\":\"VitePress\",\"description\":\"A VitePress site\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"logo\":{\"src\":\"/logo.png\",\"width\":24,\"height\":24,\"alt\":\"NezhaLogo\"},\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/nezhahq/nezhahq.github.io\"},{\"icon\":{\"svg\":\"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 496 512\\\"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d=\\\"M248 8C111 8 0 119 0 256S111 504 248 504 496 393 496 256 385 8 248 8zM363 176.7c-3.7 39.2-19.9 134.4-28.1 178.3-3.5 18.6-10.3 24.8-16.9 25.4-14.4 1.3-25.3-9.5-39.3-18.7-21.8-14.3-34.2-23.2-55.3-37.2-24.5-16.1-8.6-25 5.3-39.5 3.7-3.8 67.1-61.5 68.3-66.7 .2-.7 .3-3.1-1.2-4.4s-3.6-.8-5.1-.5q-3.3 .7-104.6 69.1-14.8 10.2-26.9 9.9c-8.9-.2-25.9-5-38.6-9.1-15.5-5-27.9-7.7-26.8-16.3q.8-6.7 18.5-13.7 108.4-47.2 144.6-62.3c68.9-28.6 83.2-33.6 92.5-33.8 2.1 0 6.6 .5 9.6 2.9a10.5 10.5 0 0 1 3.5 6.7A43.8 43.8 0 0 1 363 176.7z\\\"/></svg>\"},\"link\":\"https://t.me/nezhanews\"}],\"search\":{\"provider\":\"algolia\",\"options\":{\"appId\":\"HP6QF6KMZD\",\"apiKey\":\"fb8bae9ed373d1057e0c07fcf32b3f1a\",\"indexName\":\"nezhahq\",\"locales\":{\"root\":{\"placeholder\":\"搜索文档\",\"translations\":{\"button\":{\"buttonText\":\"搜索文档\",\"buttonAriaLabel\":\"搜索文档\"},\"modal\":{\"searchBox\":{\"resetButtonTitle\":\"清除查询条件\",\"resetButtonAriaLabel\":\"清除查询条件\",\"cancelButtonText\":\"取消\",\"cancelButtonAriaLabel\":\"取消\"},\"startScreen\":{\"recentSearchesTitle\":\"搜索历史\",\"noRecentSearchesText\":\"没有搜索历史\",\"saveRecentSearchButtonTitle\":\"保存至搜索历史\",\"removeRecentSearchButtonTitle\":\"从搜索历史中移除\",\"favoriteSearchesTitle\":\"收藏\",\"removeFavoriteSearchButtonTitle\":\"从收藏中移除\"},\"errorScreen\":{\"titleText\":\"无法获取结果\",\"helpText\":\"你可能需要检查你的网络连接\"},\"footer\":{\"selectText\":\"选择\",\"navigateText\":\"切换\",\"closeText\":\"关闭\",\"searchByText\":\"搜索提供者\"},\"noResultsScreen\":{\"noResultsText\":\"无法找到相关结果\",\"suggestedQueryText\":\"你可以尝试查询\",\"reportMissingResultsText\":\"你认为该查询应该有结果?\",\"reportMissingResultsLinkText\":\"点击反馈\"}}}}}}},\"footer\":{\"message\":\"This work is licensed under a <a rel=\\\"license\\\" href=\\\"http://creativecommons.org/licenses/by-nc-sa/4.0/\\\">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) License\",\"copyright\":\"Copyright © 2022-present NezhaHQ\"}},\"locales\":{\"root\":{\"lang\":\"zh-CN\",\"label\Line truncated
</body>
</html>