This commit is contained in:
naiba committed 2022-10-24 08:34:22 +00:00
1 parent e027cd5e7b
commit ae1088c5f6
161 files changed
+215 -215

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.e3095d59.js">
<link rel="modulepreload" href="/assets/app.31af427a.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.b07c545f.lean.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.a964b3ef.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\":\"325b742b\",\"case_case2.md\":\"f6d58436\",\"case_case3.md\":\"3d72ed6c\",\"case_case4.md\":\"37344ec2\",\"case_index.md\":\"660d5043\",\"developer_index.md\":\"91d20f33\",\"developer_l10n.md\":\"a031bc63\",\"developer_theme.md\":\"219be37f\",\"en_us_case_case1.md\":\"80ba6a6c\",\"en_us_case_case2.md\":\"7cff041b\",\"en_us_case_case3.md\":\"f2f3af0a\",\"en_us_case_case4.md\":\"53e8c093\",\"en_us_case_index.md\":\"416b21e6\",\"en_us_developer_index.md\":\"9225a2fc\",\"en_us_developer_l10n.md\":\"8d667a9e\",\"en_us_developer_theme.md\":\"ed8299a8\",\"en_us_guide_agent.md\":\"f4af2d88\",\"en_us_guide_agentq.md\":\"7fb4d341\",\"en_us_guide_api.md\":\"659c5873\",\"en_us_guide_dashboard.md\":\"1194efb9\",\"en_us_guide_dashboardq.md\":\"216acd20\",\"en_us_guide_loginq.md\":\"317f6a5f\",\"en_us_guide_notifications.md\":\"b07c545f\",\"en_us_guide_q2.md\":\"d8f3bf88\",\"en_us_guide_q3.md\":\"68bffbbf\",\"en_us_guide_q4.md\":\"b6a05f00\",\"en_us_guide_q5.md\":\"d08a5506\",\"en_us_guide_q6.md\":\"b928db30\",\"en_us_guide_q7.md\":\"9e0cafa5\",\"en_us_guide_servers.md\":\"dc1ba670\",\"en_us_guide_services.md\":\"703aeb7e\",\"en_us_guide_settings.md\":\"25cf2b83\",\"en_us_guide_tasks.md\":\"45ff15b6\",\"en_us_index.md\":\"56d3a9eb\",\"guide_agent.md\":\"dfbab6e1\",\"guide_agentq.md\":\"5d03740f\",\"guide_api.md\":\"70eb5e99\",\"guide_dashboard.md\":\"88145f0c\",\"guide_dashboardq.md\":\"05741af4\",\"guide_loginq.md\":\"3282de94\",\"guide_notifications.md\":\"db25a9e0\",\"guide_q1.md\":\"cd01f788\",\"guide_q2.md\":\"a665c2aa\",\"guide_q3.md\":\"8598af3c\",\"guide_q4.md\":\"ec32647d\",\"guide_q5.md\":\"07bd21b5\",\"guide_q6.md\":\"d1030de3\",\"guide_q7.md\":\"663794f4\",\"guide_servers.md\":\"818af0c7\",\"guide_services.md\":\"a2f5b37d\",\"guide_settings.md\":\"d5fdafd3\",\"guide_tasks.md\":\"0de83b91\",\"index.md\":\"d299c03e\"}")</script>
<script>__VP_HASH_MAP__ = JSON.parse("{\"case_case1.md\":\"6a48202f\",\"case_case2.md\":\"b80b7b41\",\"case_case3.md\":\"288c31d8\",\"case_case4.md\":\"f5843cd3\",\"case_index.md\":\"4fe867d6\",\"developer_index.md\":\"87fbeb7a\",\"developer_l10n.md\":\"d4a72e6d\",\"developer_theme.md\":\"0712c7d7\",\"en_us_case_case1.md\":\"a8cce32e\",\"en_us_case_case2.md\":\"b8938494\",\"en_us_case_case3.md\":\"c6bd0674\",\"en_us_case_case4.md\":\"695edab6\",\"en_us_case_index.md\":\"93820627\",\"en_us_developer_index.md\":\"900b57b7\",\"en_us_developer_l10n.md\":\"30a7b64a\",\"en_us_developer_theme.md\":\"6cc54156\",\"en_us_guide_agent.md\":\"e8bc4117\",\"en_us_guide_agentq.md\":\"bf532171\",\"en_us_guide_api.md\":\"ffef29aa\",\"en_us_guide_dashboard.md\":\"128cbc19\",\"en_us_guide_dashboardq.md\":\"f32b7fbe\",\"en_us_guide_loginq.md\":\"92c92b00\",\"en_us_guide_notifications.md\":\"a964b3ef\",\"en_us_guide_q2.md\":\"507afe99\",\"en_us_guide_q3.md\":\"aa4b4c9a\",\"en_us_guide_q4.md\":\"98945347\",\"en_us_guide_q5.md\":\"354e6c88\",\"en_us_guide_q6.md\":\"28e838cc\",\"en_us_guide_q7.md\":\"e802007a\",\"en_us_guide_servers.md\":\"eb3cd28a\",\"en_us_guide_services.md\":\"0e594e00\",\"en_us_guide_settings.md\":\"876b0741\",\"en_us_guide_tasks.md\":\"ce6bbbf0\",\"en_us_index.md\":\"9f7184ab\",\"guide_agent.md\":\"6566e255\",\"guide_agentq.md\":\"1e6dc99b\",\"guide_api.md\":\"58594611\",\"guide_dashboard.md\":\"31389ae2\",\"guide_dashboardq.md\":\"fe39b2ac\",\"guide_loginq.md\":\"1878b714\",\"guide_notifications.md\":\"4a15e25d\",\"guide_q1.md\":\"3f4f76eb\",\"guide_q2.md\":\"12654938\",\"guide_q3.md\":\"08238c54\",\"guide_q4.md\":\"39fa6f98\",\"guide_q5.md\":\"363a5156\",\"guide_q6.md\":\"64631719\",\"guide_q7.md\":\"c2aa9233\",\"guide_servers.md\":\"6f388725\",\"guide_services.md\":\"f1105b33\",\"guide_settings.md\":\"a28c4028\",\"guide_tasks.md\":\"21033202\",\"index.md\":\"ba590395\"}")</script>
<script type="module" async src="/assets/app.31af427a.js"></script>
</body>