This commit is contained in:
naiba committed 2022-12-22 01:58:19 +00:00
1 parent 10ce939f0c
commit 6a909b1549
161 files changed
+214 -213

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="/assets/style.0b9f658b.css">
<link rel="modulepreload" href="/assets/chunks/AlgoliaSearchBox.98396bc7.js">
<link rel="modulepreload" href="/assets/app.3817bf4e.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.46da0595.lean.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.257eabd4.lean.js">
<meta name="twitter:title" content="Flexible notification methods | Nezha Monitoring">
<meta property="og:title" content="Flexible notification methods | Nezha Monitoring">
@@ -31,7 +31,7 @@
}
}
</code></pre></div><ul><li>Notes for this method: This method requires calling Microsoft Graph V1.0, you need to go to Microsoft Graph and create your own application, give <code>Mail.Send</code> permission and get the Token, or you can go <a href="https://developer.microsoft.com/en-us/graph/graph-explorer" target="_blank" rel="noopener noreferrer">Microsoft Graph Explorer</a> directly to give permission and get the Token, just replace the Token in the Header with the actual Token.</li></ul><br><br><h2 id="description-of-notification-rules" tabindex="-1">Description of notification rules <a class="header-anchor" href="#description-of-notification-rules" aria-hidden="true">#</a></h2><h3 id="basic-rules" tabindex="-1">Basic Rules <a class="header-anchor" href="#basic-rules" aria-hidden="true">#</a></h3><ul><li>Type: one or more types can be selected, such as in a rule to select more than one type, you need to <strong>meet all the selected types at the same time</strong> to trigger the notification (see the example later) <ul><li><code>cpu</code>、<code>memory</code>、<code>swap</code>、<code>disk</code></li><li><code>net_in_speed</code> Inbound speed, <code>net_out_speed</code> Outbound speed, <code>net_all_speed</code> Inbound + Outbound speed, <code>transfer_in</code> Inbound Transfer, <code>transfer_out</code> Outbound Transfer, <code>transfer_all</code> Total Transfer</li><li><code>offline</code> Offline monitoring</li><li><code>load1</code>、<code>load5</code>、<code>load15</code> Load</li><li><code>process_count</code> Number of processes <em>Currently, counting the number of processes takes up too many resources and is not supported at the moment</em></li><li><code>tcp_conn_count</code>、<code>udp_conn_count</code> Number of connections</li></ul></li><li>duration:Lasting for a few seconds, the notification will only be triggered when the sampling record reaches 30% or more within a few seconds</li><li>min/max <ul><li>Transfer, network speed, and other values of the same type. Unit is byte (1KB=1024B,1MB = 1024*1024B)</li><li>Memory, hard disk, CPU. units are usage percentages</li><li>No setup required for offline monitoring</li></ul></li><li>cover <code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:10, &quot;cover&quot;:0, &quot;ignore&quot;:{&quot;5&quot;: true}}]</code><ul><li><code>0</code> Cover all, use <code>ignore</code> to ignore specific servers</li><li><code>1</code> Ignore all, use <code>ignore</code> to monitoring specific servers<br> For example: <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>ignore: Select to ignore specific servers, use with <code>cover</code> with server id and boolean, e.g.: <code>{&quot;1&quot;: true, &quot;2&quot;:false}</code></li></ul><p><strong>Complete examples:</strong></p><blockquote><blockquote><p>Add an offline notification</p></blockquote><ul><li>Name: Offline notification</li><li>Rules: <code>[{&quot;Type&quot;:&quot;offline&quot;,&quot;Duration&quot;:10}]</code></li><li>Enable: √</li></ul></blockquote><blockquote><blockquote><p>Add an notification when the CPU exceeds 50% for 10s <strong>but</strong> the memory usage is below 20% for 20s</p></blockquote><ul><li>Name: CPU and RAM</li><li>Rules: <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>Enable: √</li></ul></blockquote><blockquote><blockquote><p>Send specific server notifications to specific notification groups</p></blockquote><p>Case:<br> You have four servers, 1, 2, 3, 4, and two different notification groups, A and B<br> 1, 2 The two servers are down for 10 minutes and send a notification to Notification Group A<br> 3, 4 These two servers are down for ten minutes and then send a notification to Notification Group B</p><p>First you need to set up two notification groups, A and B, and then add two alarm rules:</p><p><strong>Rule I:</strong></p><ul><li>Name: 1, 2 Off-line, send notification to group A</li><li>Rules:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:600,&quot;cover&quot;:1,&quot;ignore&quot;:{&quot;1&quot;:true,&quot;2&quot;:true}}]</code></li><li>Notification group: A</li><li>Enable: √</li></ul><p><strong>Rule II:</strong></p><ul><li>Name: 3, 4 Off-line, send notification to group B</li><li>Rules:<code>[{&quot;type&quot;:&quot;offline&quot;,&quot;duration&quot;:600,&quot;cover&quot;:1,&quot;ignore&quot;:{&quot;3&quot;:true,&quot;4&quot;:true}}]</code></li><li>Notification group: B</li><li>Enable: √</li></ul></blockquote><p><strong>Using these rules flexibly will help you to make full use of the notification function</strong></p><br><h3 id="special-any-cycle-transfer-notification" tabindex="-1">Special: Any-cycle transfer notification <a class="header-anchor" hrefLine truncated
<script>__VP_HASH_MAP__ = JSON.parse("{\"case_case1.md\":\"e5271161\",\"case_case2.md\":\"862f8976\",\"case_case3.md\":\"96da5d26\",\"case_case4.md\":\"22891e4e\",\"case_index.md\":\"c5c6123f\",\"developer_index.md\":\"e64a7727\",\"developer_l10n.md\":\"5d8b8975\",\"developer_theme.md\":\"34c5fa3d\",\"en_us_case_case1.md\":\"4091cfa2\",\"en_us_case_case2.md\":\"e8a26812\",\"en_us_case_case3.md\":\"a061aba3\",\"en_us_case_case4.md\":\"afd80b92\",\"en_us_case_index.md\":\"c8fe8dd7\",\"en_us_developer_index.md\":\"67e1b853\",\"en_us_developer_l10n.md\":\"96ef32ac\",\"en_us_developer_theme.md\":\"1052555f\",\"en_us_guide_agent.md\":\"247b8265\",\"en_us_guide_agentq.md\":\"a5513fa9\",\"en_us_guide_api.md\":\"d68b18e4\",\"en_us_guide_dashboard.md\":\"ff948866\",\"en_us_guide_dashboardq.md\":\"db5641eb\",\"en_us_guide_loginq.md\":\"f23735c7\",\"en_us_guide_notifications.md\":\"46da0595\",\"en_us_guide_q2.md\":\"679f148a\",\"en_us_guide_q3.md\":\"52e0404a\",\"en_us_guide_q4.md\":\"ffdfe5ae\",\"en_us_guide_q5.md\":\"c7eb5527\",\"en_us_guide_q6.md\":\"96c90b34\",\"en_us_guide_q7.md\":\"0da0433d\",\"en_us_guide_servers.md\":\"884f064e\",\"en_us_guide_services.md\":\"0e5392b7\",\"en_us_guide_settings.md\":\"a946703e\",\"en_us_guide_tasks.md\":\"68c5e190\",\"en_us_index.md\":\"5a113ca1\",\"guide_agent.md\":\"e9c60dc8\",\"guide_agentq.md\":\"f0502fa4\",\"guide_api.md\":\"e2ef4eca\",\"guide_dashboard.md\":\"fc2f20f7\",\"guide_dashboardq.md\":\"3cf7f07c\",\"guide_loginq.md\":\"83fff092\",\"guide_notifications.md\":\"d13287eb\",\"guide_q1.md\":\"45ab4337\",\"guide_q2.md\":\"95153ca7\",\"guide_q3.md\":\"4f297a52\",\"guide_q4.md\":\"bacb96eb\",\"guide_q5.md\":\"c70b2c67\",\"guide_q6.md\":\"9d0b29fa\",\"guide_q7.md\":\"ddaf1276\",\"guide_servers.md\":\"f384912a\",\"guide_services.md\":\"bab5d111\",\"guide_settings.md\":\"e02ebe4a\",\"guide_tasks.md\":\"fff32bc5\",\"index.md\":\"440dcbbc\"}")</script>
<script>__VP_HASH_MAP__ = JSON.parse("{\"case_case1.md\":\"1e23811b\",\"case_case2.md\":\"26feef00\",\"case_case3.md\":\"867f5aea\",\"case_case4.md\":\"507956de\",\"case_index.md\":\"586ef1e5\",\"developer_index.md\":\"7d58e91a\",\"developer_l10n.md\":\"2ecd4271\",\"developer_theme.md\":\"6422a97c\",\"en_us_case_case1.md\":\"3ec9133d\",\"en_us_case_case2.md\":\"62382f74\",\"en_us_case_case3.md\":\"b825ce92\",\"en_us_case_case4.md\":\"c511860d\",\"en_us_case_index.md\":\"78b4778c\",\"en_us_developer_index.md\":\"4bf9788e\",\"en_us_developer_l10n.md\":\"c9f29000\",\"en_us_developer_theme.md\":\"4a534d77\",\"en_us_guide_agent.md\":\"bd84560c\",\"en_us_guide_agentq.md\":\"d6d516d5\",\"en_us_guide_api.md\":\"51042421\",\"en_us_guide_dashboard.md\":\"2e8bbde9\",\"en_us_guide_dashboardq.md\":\"15aeb22f\",\"en_us_guide_loginq.md\":\"cf68efdc\",\"en_us_guide_notifications.md\":\"257eabd4\",\"en_us_guide_q2.md\":\"0af394a5\",\"en_us_guide_q3.md\":\"fd0c509d\",\"en_us_guide_q4.md\":\"1f876fb8\",\"en_us_guide_q5.md\":\"256721b5\",\"en_us_guide_q6.md\":\"2566ab55\",\"en_us_guide_q7.md\":\"143a055c\",\"en_us_guide_servers.md\":\"8b7fa250\",\"en_us_guide_services.md\":\"5c26c6fe\",\"en_us_guide_settings.md\":\"821bfd88\",\"en_us_guide_tasks.md\":\"04f2d8a8\",\"en_us_index.md\":\"2c52635b\",\"guide_agent.md\":\"d63b5c68\",\"guide_agentq.md\":\"e4b7a905\",\"guide_api.md\":\"f1247c62\",\"guide_dashboard.md\":\"99368545\",\"guide_dashboardq.md\":\"23a01fff\",\"guide_loginq.md\":\"6e62eb50\",\"guide_notifications.md\":\"ab5fcfbe\",\"guide_q1.md\":\"f57259d1\",\"guide_q2.md\":\"da3e96e8\",\"guide_q3.md\":\"7690724f\",\"guide_q4.md\":\"b8c44693\",\"guide_q5.md\":\"d3d003ef\",\"guide_q6.md\":\"5b9401d2\",\"guide_q7.md\":\"8ab0d28c\",\"guide_servers.md\":\"3ebbe4be\",\"guide_services.md\":\"3c7b8dc9\",\"guide_settings.md\":\"ae220f0c\",\"guide_tasks.md\":\"d7b4e29f\",\"index.md\":\"dd47ea90\"}")</script>
<script type="module" async src="/assets/app.3817bf4e.js"></script>
</body>