This commit is contained in:
hhhkkk520 committed 2022-07-31 11:14:27 +00:00
1 parent 59c046074c
commit 8fc155de20
155 files changed
+213 -215

No files matched your search

+3 -3
View File
@@ -8,7 +8,7 @@
<link rel="stylesheet" href="/assets/style.0b9f658b.css">
<link rel="modulepreload" href="/assets/chunks/AlgoliaSearchBox.2b248d1a.js">
<link rel="modulepreload" href="/assets/app.4f7c959e.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.1a9c40fd.lean.js">
<link rel="modulepreload" href="/assets/en_US_guide_notifications.md.8b453af1.lean.js">
<meta name="twitter:title" content="Flexible notification methods | Nezha Monitoring">
<meta property="og:title" content="Flexible notification methods | Nezha Monitoring">
@@ -30,8 +30,8 @@
]
}
}
</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><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Add an offline notification</p><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></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Add an notification when the CPU exceeds 50% for 10s <strong>but</strong> the memory usage is below 20% for 20s</p><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></div><br><h3 id="special-any-cycle-transfer-notification" tabindex="-1">Special: Any-cycle transfer notification <a class="header-anchor" href="#special-any-cycle-transfer-notification" aria-hidden="true">#</a></h3><p>Can be used as monthly transfer notificatin</p><ul><li><p>type</p><ul><li><code>transfer_in_cycle</code> Inbound transfer during the cycle</li><li><code>transfer_out_cycle</code> Outbound transfer during the cycle</li><li><code>transfer_all_cycle</code> The sum of inbound and outbound transfer during the cycle</li></ul></li><li><p><code>cycle_start</code> Start date of the statistical cycle (can be the start date of your server&#39;s billing cycle), the time format is RFC3339, for example, the format in Beijing time zone is <code>2022-01-11T08:00:00.00+08:00</code></p></li><li><p><code>cycle_interval</code> Interval time cycle (For example, if the cycle is in days and the value is 7, it means that the statistics are counted every 7 days)</p></li><li><p><code>cycle_unit</code> Statistics cycle unit, default <code>hour</code>, optional (<code>hour</code>, <code>day</code>, <code>week</code>, <code>month</code>, <code>year</code>)</p></li><li><p><code>min/max</code>, <code>cover</code>, <code>ignore</code> Please refer to the basic rules to configure</p></li></ul><p>Example: The servers with ID 3 and 4 (defined in the <code>ignore</cLine truncated
<script>__VP_HASH_MAP__ = JSON.parse("{\"case_case1.md\":\"5389ffe1\",\"case_case2.md\":\"8ab62680\",\"case_case3.md\":\"eac0c1a5\",\"case_case4.md\":\"e2118e33\",\"case_index.md\":\"75fca096\",\"developer_index.md\":\"e23b837e\",\"developer_l10n.md\":\"840c0d07\",\"developer_theme.md\":\"679dc541\",\"en_us_case_case1.md\":\"8df6c7fc\",\"en_us_case_case2.md\":\"4917efeb\",\"en_us_case_case3.md\":\"941cecca\",\"en_us_case_case4.md\":\"30314c60\",\"en_us_case_index.md\":\"7235b7f6\",\"en_us_developer_index.md\":\"8ddc5453\",\"en_us_developer_l10n.md\":\"0eb04dfe\",\"en_us_developer_theme.md\":\"e11a6d18\",\"en_us_guide_agent.md\":\"73107b1c\",\"en_us_guide_agentq.md\":\"0cfd7d88\",\"en_us_guide_api.md\":\"7886b6fe\",\"en_us_guide_dashboard.md\":\"ad272a0a\",\"en_us_guide_dashboardq.md\":\"1a26af17\",\"en_us_guide_loginq.md\":\"8c0a5e93\",\"en_us_guide_notifications.md\":\"1a9c40fd\",\"en_us_guide_q2.md\":\"e0968dd7\",\"en_us_guide_q3.md\":\"5e477958\",\"en_us_guide_q4.md\":\"c8a16fd0\",\"en_us_guide_q5.md\":\"422daa6d\",\"en_us_guide_q6.md\":\"fd294ff1\",\"en_us_guide_servers.md\":\"e055fa8e\",\"en_us_guide_services.md\":\"3bb04c30\",\"en_us_guide_settings.md\":\"5430f68f\",\"en_us_guide_tasks.md\":\"e379f41d\",\"en_us_index.md\":\"d7adc9a4\",\"guide_agent.md\":\"427440af\",\"guide_agentq.md\":\"d909a212\",\"guide_api.md\":\"f457f711\",\"guide_dashboard.md\":\"2e1ababb\",\"guide_dashboardq.md\":\"657ef0e3\",\"guide_loginq.md\":\"6165c9b4\",\"guide_notifications.md\":\"6760f88d\",\"guide_q1.md\":\"ce9fd46b\",\"guide_q2.md\":\"73510ebb\",\"guide_q3.md\":\"e17d3891\",\"guide_q4.md\":\"9fb8fb55\",\"guide_q5.md\":\"bb7f6e1d\",\"guide_q6.md\":\"6db15546\",\"guide_servers.md\":\"8cac9ba1\",\"guide_services.md\":\"0399faa5\",\"guide_settings.md\":\"9af8ce37\",\"guide_tasks.md\":\"8532fbc8\",\"index.md\":\"36770051\"}")</script>
</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\":\"6f7e6069\",\"case_case2.md\":\"cca93a97\",\"case_case3.md\":\"1f00aa7a\",\"case_case4.md\":\"24a6a53d\",\"case_index.md\":\"af904abd\",\"developer_index.md\":\"cd97e075\",\"developer_l10n.md\":\"6720e182\",\"developer_theme.md\":\"3935aec4\",\"en_us_case_case1.md\":\"6c1892ce\",\"en_us_case_case2.md\":\"3228474d\",\"en_us_case_case3.md\":\"ae3159aa\",\"en_us_case_case4.md\":\"cd3f1565\",\"en_us_case_index.md\":\"2e3a3d9f\",\"en_us_developer_index.md\":\"d16fa60e\",\"en_us_developer_l10n.md\":\"9fac1129\",\"en_us_developer_theme.md\":\"6b130c0d\",\"en_us_guide_agent.md\":\"f3a0c1a0\",\"en_us_guide_agentq.md\":\"604eab70\",\"en_us_guide_api.md\":\"9af6e288\",\"en_us_guide_dashboard.md\":\"596e5912\",\"en_us_guide_dashboardq.md\":\"c6755629\",\"en_us_guide_loginq.md\":\"5d82fa94\",\"en_us_guide_notifications.md\":\"8b453af1\",\"en_us_guide_q2.md\":\"dbed2065\",\"en_us_guide_q3.md\":\"875ada63\",\"en_us_guide_q4.md\":\"883b2ac7\",\"en_us_guide_q5.md\":\"2b3071b0\",\"en_us_guide_q6.md\":\"92123128\",\"en_us_guide_servers.md\":\"c6195784\",\"en_us_guide_services.md\":\"52b2c10c\",\"en_us_guide_settings.md\":\"57cae1da\",\"en_us_guide_tasks.md\":\"61bf5dbe\",\"en_us_index.md\":\"6c644b12\",\"guide_agent.md\":\"1fe0bf05\",\"guide_agentq.md\":\"86eace6c\",\"guide_api.md\":\"8823a7c0\",\"guide_dashboard.md\":\"8872d788\",\"guide_dashboardq.md\":\"997b1c25\",\"guide_loginq.md\":\"b108a6ec\",\"guide_notifications.md\":\"1e02df00\",\"guide_q1.md\":\"a3aae6ee\",\"guide_q2.md\":\"3d0dcc8a\",\"guide_q3.md\":\"b3160c5d\",\"guide_q4.md\":\"2de2a085\",\"guide_q5.md\":\"f4d0fa50\",\"guide_q6.md\":\"01141912\",\"guide_servers.md\":\"cec4a3b4\",\"guide_services.md\":\"c5ea8d07\",\"guide_settings.md\":\"586f244e\",\"guide_tasks.md\":\"d538622f\",\"index.md\":\"8a564e81\"}")</script>
<script type="module" async src="/assets/app.4f7c959e.js"></script>
</body>