Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47d9801135 | ||
|
|
c5f7a3f9e1 | ||
|
|
17fdbe85b7 | ||
|
|
2596cfc0f7 | ||
|
|
7031d7c0ff | ||
|
|
5e0fe07039 | ||
|
|
78da18f925 | ||
|
|
61eaa16243 | ||
|
|
63602d07b4 | ||
|
|
790cd059e3 | ||
|
|
065562e8c8 | ||
|
|
d4c97b0bd3 | ||
|
|
2cc54af768 | ||
|
|
515008f063 |
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: aiConfig
|
||||
id: ai_config
|
||||
title: AI QuickStart
|
||||
sidebar_label: AI QuickStartr
|
||||
sidebar_label: AI QuickStart
|
||||
keywords: [AI]
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: alarm_silence
|
||||
title: Alert Silence
|
||||
sidebar_label: Alert Silence
|
||||
title: Alarm Silence
|
||||
sidebar_label: Alarm Silence
|
||||
keywords: [ Open Source Monitoring System, Alert Silence ]
|
||||
---
|
||||
|
||||
|
||||
@@ -1,55 +1,43 @@
|
||||
---
|
||||
id: alert_threshold
|
||||
title: Threshold Alert Configuration
|
||||
sidebar_label: Threshold Alert Configuration
|
||||
title: Alarm Threshold Configuration
|
||||
sidebar_label: Alarm Threshold
|
||||
---
|
||||
|
||||
> Configure alert thresholds for monitoring metrics (warning alert, critical alert, emergency alert). The system triggers alerts based on threshold configuration and collected metric data.
|
||||
:::tip
|
||||
Alarm Threshold are the core function of `HertzBeat`, users can configure the trigger conditions of the alarm through the threshold rules.
|
||||
Support real-time threshold and scheduled threshold, real-time threshold can directly trigger the alarm when monitoring data is collected, scheduled threshold supports PromQL and other expressions to calculate the trigger alarm within a specified time period.
|
||||
Support visual page configuration or more flexible expression rule configuration, support configuring trigger times, alarm levels, notification templates, associated specified monitoring and so on.
|
||||
:::
|
||||
|
||||
## Operational Steps
|
||||

|
||||
|
||||
### 1. Setting Labels for Monitoring Services (Optional)
|
||||
## Real-time Threshold
|
||||
|
||||
If you need to categorize alerts, you can set labels for the monitored targets. For example: If you have multiple Linux systems to monitor, and each system has different monitoring metrics, such as: Server A has available memory greater than 1G, Server B has available memory greater than 2G, then you can set labels for Server A and Server B respectively, and then configure alerts based on these labels.
|
||||
|
||||
#### Creating Labels
|
||||
|
||||
Navigate to **Label Management -> Add Label**
|
||||
|
||||

|
||||
|
||||
As shown in the image above, add a new label. Here we set the label as: linux:dev (Linux used in development environment).
|
||||
|
||||
#### Configuring Labels
|
||||
|
||||
TODO Update image name
|
||||

|
||||
|
||||
As shown in the image above, click on `Add Label`.
|
||||
|
||||

|
||||
|
||||
Select our label, here demonstrated as selecting the `linux:dev` label.
|
||||
> Real-time threshold means that the alarm is triggered directly when the monitoring data is collected, which is suitable for scenarios with high real-time requirements.
|
||||
|
||||
### Creating Threshold Rules
|
||||
|
||||
Navigate to **[Threshold Rules] -> [Add Threshold Rule] -> [Confirm Configuration]**
|
||||
> HertzBeat Page -> Alerting -> Threshold -> New Threshold -> ReadTime Threshold Rule
|
||||
|
||||

|
||||
Configure the threshold, for example: Select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
|
||||
|
||||
The above image explains the configuration details:
|
||||

|
||||
|
||||
Configuration item details:
|
||||
|
||||
- **Rule Name**:Unique name defining this threshold rule
|
||||
- **Metric Object**: Select the monitoring metric object for which we need to configure the threshold. For example: Under website monitoring type -> under the summary metric set -> responseTime metric.
|
||||
- **Threshold Rule**: Use this expression to calculate whether to trigger the threshold. Expression variables and operators are provided on the page for reference. For example: Set an alert to trigger if response time is greater than 50, the expression would be `responseTime > 50`. For detailed help on threshold expressions, see [Threshold Expression Help](alert_threshold_expr).
|
||||
- **Threshold Rule**: Configure the alarm trigger rules for specific indicators, support graphical interface and expression rules. For expression environment variables and operators, see the page prompts. For detailed help on threshold expressions, see [Threshold Expression Help](alert_threshold_expr).
|
||||
- **Associated Monitors**:Apply this threshold rule to the specified monitoring object (support direct binding and label association). If not configured, it will be applied to all monitoring objects that meet this threshold type rule.
|
||||
- **Alert Level**: The alert level triggered by the threshold, from low to high: warning, critical, emergency.
|
||||
- **Trigger Count**: Set how many times the threshold must be triggered before the alert is actually triggered.
|
||||
- **Notification Template**: The template for the notification message sent after the alert is triggered. Template variables are provided on the page. For example: `${app}.${metrics}.${metric} metric value is ${responseTime}, which is greater than 50 triggering the alert`.
|
||||
- **Bind Label**: Select the label we need to apply. If no label is selected, it will apply to all services corresponding to the set metric object.
|
||||
- **Apply Globally**: Set whether this threshold applies globally to all such metrics, default is no. After adding a threshold, it needs to be associated with the monitoring object for the threshold to take effect.
|
||||
- **Recovery Notification**: Whether to send a recovery notification after the alert is triggered, default is not to send.
|
||||
- **Bing Annotation**:Add annotation information to this threshold rule (the annotation content supports environment variables). When an alarm is generated, this annotation information will be rendered and attached to the alarm.
|
||||
- **Enable Alert**: Enable or disable this alert threshold configuration.
|
||||
|
||||
**The threshold alert configuration is complete, and alerts that have been successfully triggered can be viewed in the [Alert Center].**
|
||||
**If you need to send alert notifications via email, WeChat, DingTalk, or Feishu, you can configure it in [Alert Notifications].**
|
||||
**The threshold alert configuration is complete, and alerts that have been successfully triggered can be viewed in the [Alarm Center].**
|
||||
**If you need to send alert notifications via email, WeChat, DingTalk, or Feishu, you can configure it in [Notification].**
|
||||
|
||||
For other issues, you can provide feedback through the community chat group or issue tracker!
|
||||
## Scheduled Threshold
|
||||
|
||||
@@ -7,15 +7,6 @@ slug: /
|
||||
|
||||
> A real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
|
||||
[](https://discord.gg/Fb6M73htGr)
|
||||
[](https://www.reddit.com/r/hertzbeat/)
|
||||
[](https://x.com/hertzbeat1024)
|
||||
[](https://www.bestpractices.dev/projects/8139)
|
||||
[](https://hub.docker.com/r/apache/hertzbeat)
|
||||
[](https://artifacthub.io/packages/search?repo=hertzbeat)
|
||||
[](https://qm.qq.com/q/FltGGGIX2m)
|
||||
[](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow)
|
||||
|
||||
**Home: [hertzbeat.apache.org](https://hertzbeat.apache.org)**
|
||||
|
||||
## 🎡 <font color="green">Introduction</font>
|
||||
@@ -36,7 +27,7 @@ slug: /
|
||||
|
||||
---
|
||||
|
||||
### Powerful Monitoring Templates
|
||||
### Powerful Monitoring Template
|
||||
|
||||
> Before we discuss the customizable monitoring capabilities of HertzBeat, which we mentioned at the beginning, let's introduce the different monitoring templates of HertzBeat. And it is because of this monitoring template design that the advanced features come later.
|
||||
|
||||
@@ -91,7 +82,7 @@ Do you believe that users can just write a monitoring template on the UI page, c
|
||||
* And More Your Custom Template.
|
||||
* Notified Support `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`.
|
||||
|
||||
### Powerful Customization
|
||||
### Customization
|
||||
|
||||
> From the previous introduction of **Monitoring Templates**, it is clear that `HertzBeat` has powerful customization features.
|
||||
> Each monitor type is considered as a monitor template, no matter it is built-in or user-defined. You can easily add, modify and delete indicators by modifying the monitoring template.
|
||||
@@ -156,7 +147,7 @@ In an isolated network where multiple networks are not connected, we need to dep
|
||||
|
||||
---
|
||||
|
||||
## Quickly Start
|
||||
## 🥐 Experience Now
|
||||
|
||||
Just run a single command in a Docker environment: `docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
|
||||
Browser access `http://localhost:1157` default account password `admin/hertzbeat`
|
||||
@@ -171,7 +162,7 @@ Browser access `http://localhost:1157` default account password `admin/hertzbeat
|
||||
|
||||
* The global overview page shows the distribution of current monitoring categories, users can visualize the current monitoring types and quantities and click to jump to the corresponding monitoring types for maintenance and management.
|
||||
* Show the status of currently registered collector clusters, including collector on-line status, monitoring tasks, startup time, IP address, name and so on.
|
||||
* Show the list of recent alarm messages, alarm level distribution and alarm processing rate.
|
||||
* Show the list of recent alarm messages, alarm level distribution etc.
|
||||
|
||||

|
||||
|
||||
@@ -222,7 +213,7 @@ Built-in support for monitoring types include:
|
||||
|
||||

|
||||
|
||||
### Add and Modify Surveillance
|
||||
### New Monitor
|
||||
|
||||
* You can add or modify monitoring instances of a specific monitoring type, configure the IP, port and other parameters of the monitoring on the other end, set the collection period, collection task scheduling method, support detecting availability in advance, etc. The monitoring instances on the page are defined by the corresponding monitoring templates.
|
||||
* The monitoring parameters configured on the page are defined by the monitoring template of the corresponding monitoring type, and users can modify the configuration parameters on the page by modifying the monitoring template.
|
||||
@@ -235,7 +226,7 @@ Built-in support for monitoring types include:
|
||||
* The monitoring data detail page shows the basic parameter information of the current monitoring, and the monitoring indicator data information.
|
||||
* Monitor Real-time Data Report displays the real-time values of all the currently monitored indicators in the form of a list of small cards, and users can configure alarm threshold rules based on the real-time values for reference.
|
||||
* Monitor Historical Data Report displays the historical values of the currently monitored metrics in the form of trend charts, supports querying hourly, daily and monthly historical data, and supports configuring the page refresh time.
|
||||
* ⚠️ Note that the monitoring history charts need to be configured with an external timing database in order to get the full functionality, timing database support: IOTDB, TDengine, InfluxDB, GreptimeDB
|
||||
* ⚠️ Note that the monitoring history charts need to be configured with an external timing database in order to get the full functionality.
|
||||
|
||||

|
||||
|
||||
@@ -248,24 +239,34 @@ Built-in support for monitoring types include:
|
||||
|
||||

|
||||
|
||||
### Threshold Rules
|
||||
### Alarm Threshold
|
||||
|
||||
* Threshold rules can be configured for monitoring the availability status, and alerts can be issued when the value of a particular metric exceeds the expected range.
|
||||
* There are three levels of alerts: notification alerts, critical alerts, and emergency alerts.
|
||||
* Threshold rules support visual page configuration or expression rule configuration for more flexibility.
|
||||
* It supports configuring the number of triggers, alarm levels, notification templates, associated with a specific monitor and so on.
|
||||
* Alarm Threshold are the core function of `HertzBeat`, users can configure the trigger conditions of the alarm through the threshold rules.
|
||||
* Support real-time threshold and scheduled threshold, real-time threshold can directly trigger the alarm when monitoring data is collected, scheduled threshold supports PromQL and other expressions to calculate the trigger alarm within a specified time period.
|
||||
* Support visual page configuration or more flexible expression rule configuration, support configuring trigger times, alarm levels, notification templates, associated specified monitoring and so on.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Alarm Integration
|
||||
|
||||
* Integration with third-party monitoring systems such as `Prometheus`, `WebHook`, `Skywalking`, `AlertManager`, etc. to receive alarm messages from these systems and perform alarm processing.
|
||||
|
||||

|
||||
|
||||
### Alarm Convergence
|
||||
### Alarm Grouping
|
||||
|
||||
* When the alarm is triggered by the threshold rule, it will enter into the alarm convergence, the alarm convergence will be based on the rules of the specific time period of the duplicate alarm message de-emphasis convergence, to avoid a large number of repetitive alarms lead to the receiver alarm numbness.
|
||||
* Alarm convergence rules support duplicate alarm effective time period, label matching and alarm level matching filter.
|
||||
* Group convergence supports merging alarms for specified group labels by grouping. It deduplicates and converges the same repeated alarms in a time period.
|
||||
* When the threshold rule triggers an alarm or an external alarm is reported, it will enter the grouping convergence for alarm grouping and alarm deduplication to avoid alarm storms caused by a large number of alarm messages.
|
||||
|
||||

|
||||
|
||||
### Alarm Inhibition
|
||||
|
||||
* Alarm suppression is used to configure the suppression relationship between alarms. For example, high-level alarms suppress low-level alarms under the same instance.
|
||||
* When an alarm occurs, it can suppress the occurrence of other alarms. For example, when a server crashes, it can suppress all alarms on that server.
|
||||
|
||||

|
||||
|
||||
### Alarm Silence
|
||||
@@ -274,8 +275,6 @@ Built-in support for monitoring types include:
|
||||
* This application scenario, such as users in the system maintenance, do not need to send known alarms. Users will only receive alarm messages on weekdays, and users need to avoid disturbances at night.
|
||||
* Alarm silence rules support one-time time period or periodic time period, support label matching and alarm level matching.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Message Notification
|
||||
@@ -292,17 +291,38 @@ Built-in support for monitoring types include:
|
||||
|
||||

|
||||
|
||||
### Monitoring Templates
|
||||

|
||||
|
||||
### Monitoring Template
|
||||
|
||||
* HertzBeat makes `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` and other protocols configurable so that you can customize the metrics you want to collect using these protocols by simply configuring the monitoring template `YML` in your browser. Would you believe that you can instantly adapt a new monitoring type such as `K8s` or `Docker` just by configuring it?
|
||||
* All our built-in monitoring types (mysql, website, jvm, k8s) are also mapped to corresponding monitoring templates, so you can add and modify monitoring templates to customize your monitoring functions.
|
||||
|
||||

|
||||
|
||||
### Collector Cluster
|
||||
|
||||
* Users can configure collector clusters to achieve distributed collection of large-scale monitoring tasks.
|
||||
* The collector cluster supports multi-node deployment, automatic load balancing, automatic failover, etc.
|
||||
* Supports unified management of multiple isolated networks, cloud-edge collaboration.
|
||||
|
||||

|
||||
|
||||
### Status Page
|
||||
|
||||
* Based on HertzBeat, quickly build an external status page for your own product and easily convey the real-time status of your product service to users. For example, the service status page provided by Github <https://www.githubstatus.com>.
|
||||
* Support synchronization between the status of the status page component and the monitoring status, as well as the fault event maintenance management mechanism, etc. Improve your transparency, professionalism, and user trust, and reduce communication costs.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
**There's so much more to discover. Have Fun!**
|
||||
**More functions are welcome to be explored. Have Fun!**
|
||||
|
||||
---
|
||||
|
||||
**Github: <https://github.com/apache/hertzbeat>**
|
||||
|
||||
**Home: <https://hertzbeat.apache.org/>**
|
||||
|
||||
@@ -6,8 +6,12 @@ sidebar_label: Update to 1.6.0 guide
|
||||
|
||||
## HertzBeat 1.6.0 Upgrade Guide
|
||||
|
||||
**Note: This guide is applicable for upgrading from 1.5.0 to 1.6.0 to version 1.6.0.**
|
||||
**If you are using an older version, it is recommended to reinstall using the export function, or upgrade to 1.5.0 and then follow this guide to 1.6.0.**
|
||||
:::note
|
||||
This guide is applicable for upgrading from 1.5.0 to 1.6.0 to version 1.6.0.
|
||||
If you are using an older version, it is recommended to reinstall using the export function, or upgrade to 1.5.0 and then follow this guide to 1.6.0.
|
||||
:::
|
||||
|
||||
Follow the [HertzBeat New Version Upgrade](upgrade)
|
||||
|
||||
## Binary Installation Package Upgrade
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
id: 1.7.0-update
|
||||
title: How to update to 1.7.0
|
||||
sidebar_label: Update to 1.7.0 guide
|
||||
---
|
||||
|
||||
## HertzBeat 1.7.0 Upgrade Guide
|
||||
|
||||
:::note
|
||||
This guide is applicable for upgrading from 1.6.x to version 1.7.0.
|
||||
If you are using an older version, it is recommended to reinstall using the export function, or upgrade to 1.6.0 and then follow this guide to 1.7.0.
|
||||
:::
|
||||
|
||||
Follow the [HertzBeat New Version Upgrade](upgrade)
|
||||
|
||||
## Installation Upgrade
|
||||
|
||||
### Upgrade Database
|
||||
|
||||
In 1.7.0, we use the `label` instead of `tag`, in some environment, we need drop or delete the table `hzb_tag_monitor_bind` in database.
|
||||
|
||||
```sql
|
||||
DELETE FROM hzb_tag_monitor_bind;
|
||||
```
|
||||
|
||||
### Upgrade Alarm Threshold
|
||||
|
||||
In 1.7.0, we redesign the new alarm threshold, include the Real-Time Threshold and Scheduled Threshold.
|
||||
We need reconfigure the alarm threshold, alarm group by manual.
|
||||
|
||||
:::tip
|
||||
There are no default built-in threshold rules, such as the previous availability threshold.
|
||||
So if you find that there is no alarm after the monitoring is down, you need to configure the corresponding availability threshold yourself.
|
||||
:::
|
||||
|
||||
## Upgrade via Export and Import
|
||||
|
||||
If you do not want to go through the tedious script upgrade method mentioned above, you can directly export and import the monitoring tasks and threshold information from the old environment.
|
||||
|
||||
- Deploy a new environment with the latest version.
|
||||
- Export the monitoring tasks and threshold information from the old environment on the page
|
||||
@@ -1,39 +1,45 @@
|
||||
---
|
||||
id: ssl-cert-practice
|
||||
title: SSL Certificate Monitor Practice
|
||||
sidebar_label: SSL Certificate Monitor Practice
|
||||
title: SSL Certificate Monitoring Practice
|
||||
sidebar_label: SSL Certificate Monitoring Practice
|
||||
---
|
||||
|
||||
:::tip
|
||||
Most websites now support HTTPS by default. The certificate we apply for is usually 3 months or 1 year. It is easy to expire the SSL certificate over time, but we did not find it the first time, or did not update the certificate in time before it expired.
|
||||
:::
|
||||
|
||||
This article introduces how to use the hertzbeat monitoring tool to detect the validity period of our website's SSL certificate, and send us a warning message when the certificate expires or a few days before the certificate expires.
|
||||
|
||||
#### What is HertzBeat
|
||||
## What is HertzBeat
|
||||
|
||||
Apache HertzBeat (incubating) is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
|
||||
github: <https://github.com/apache/hertzbeat>
|
||||
|
||||
#### Install HertzBeat
|
||||
## Install HertzBeat
|
||||
|
||||
1. The `docker` environment can be installed with just one command
|
||||
|
||||
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
|
||||
`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
|
||||
|
||||
2. After the installation is successful, the browser can access `localhost:1157` to start, the default account password is `admin/hertzbeat`
|
||||
|
||||
#### Monitoring SSL certificates
|
||||
:::note
|
||||
The production environment recommends a complete deployment method, refer <https://hertzbeat.apache.org/docs/start/docker-compose-deploy>
|
||||
:::
|
||||
|
||||
## Monitoring SSL Certificates
|
||||
|
||||
1. Click Add SSL Certificate Monitor
|
||||
|
||||
> System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate
|
||||
> HertzBeat Page -> Monitors Menu -> New Monitor -> Service Monitor -> Add SSL Certificate
|
||||
|
||||

|
||||
|
||||
2. Configure the monitoring website
|
||||
|
||||
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
|
||||
> Click OK Note ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button.
|
||||
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
|
||||
> Click OK Note
|
||||
|
||||

|
||||
|
||||
@@ -43,51 +49,46 @@ github: <https://github.com/apache/hertzbeat>
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
4. Set the threshold (triggered when the certificate expires)
|
||||
|
||||
> System Page -> Alarms -> Alarm Thresholds -> New Thresholds
|
||||
|
||||

|
||||
|
||||
> HertzBeat Page -> Alerting -> Threshold -> New Threshold -> ReadTime Threshold Rule
|
||||
> Configure the threshold, select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
|
||||
|
||||

|
||||
|
||||
> Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to.
|
||||
|
||||

|
||||
> Threshold rule has others function you can try eg: associating thresholds with monitoring, trigger times so on.
|
||||
|
||||
5. Set the threshold (triggered one week before the certificate expires)
|
||||
|
||||
> In the same way, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now( ) + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds.
|
||||
> In the same way, switch coding threshold, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now() + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds.
|
||||
|
||||

|
||||

|
||||
|
||||
> Finally, you can see the triggered alarm in the alarm center.
|
||||
|
||||

|
||||

|
||||
|
||||
6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.)
|
||||
|
||||
> Monitoring Tool -> Alarm Notification -> New Receiver
|
||||
> HertzBeat Page -> Notification -> Notice Receiver -> New Receiver -> Config the Feishu Receiver
|
||||
|
||||

|
||||

|
||||
|
||||
For token configuration such as Dingding WeChat Feishu, please refer to the help document
|
||||
For token configuration such as Feishu, please refer to the help document
|
||||
|
||||
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
|
||||
<https://hertzbeat.apache.org/docs/help/alert_feishu>
|
||||
|
||||
> Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured
|
||||
> Notification -> Notice Policy -> New Notice Policy -> Enable Notification for the Recipient Just Configured
|
||||
|
||||

|
||||

|
||||
|
||||
7. OK When the threshold is triggered, we can receive the corresponding alarm message. If there is no notification, you can also view the alarm information in the alarm center.
|
||||
|
||||
----
|
||||
|
||||
#### Finish
|
||||
## The End
|
||||
|
||||
The practice of monitoring SSL certificates is here. Of course, for hertzbeat, this function is just the tip of the iceberg. If you think hertzbeat is a good open source project, please give us a Gitee star on GitHub, thank you very much. Thank you for your support. Refill!
|
||||
|
||||
@@ -47,16 +47,12 @@
|
||||
"message": "Server Monitor",
|
||||
"description": "The label for category Server in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.threshold": {
|
||||
"message": "Threshold Alarm Setting",
|
||||
"description": "The label for category threshold in sidebar docs"
|
||||
"sidebar.docs.category.alert": {
|
||||
"message": "Alerting",
|
||||
"description": "The label for category alert in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.reduce": {
|
||||
"message": "Alarm Reduce Setting",
|
||||
"description": "The label for category reduce in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.notice": {
|
||||
"message": "Alarm Notice Setting",
|
||||
"message": "Notification",
|
||||
"description": "The label for category notice in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.mid": {
|
||||
|
||||
@@ -51,16 +51,12 @@
|
||||
"message": "中间件监控",
|
||||
"description": "The label for category mid in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.threshold": {
|
||||
"message": "阈值告警配置",
|
||||
"sidebar.docs.category.alert": {
|
||||
"message": "阈值告警",
|
||||
"description": "The label for category threshold in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.reduce": {
|
||||
"message": "告警收敛配置",
|
||||
"description": "The label for category reduce in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.notice": {
|
||||
"message": "告警通知配置",
|
||||
"message": "消息通知",
|
||||
"description": "The label for category notice in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Others": {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
id: aiConfig
|
||||
id: ai_config
|
||||
title: AI 快速入门
|
||||
sidebar_label: AI 快速入门
|
||||
keywords: [人工智能 AI]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: alert_enterprise_wechat_app
|
||||
title: 企业微信应用告警通知
|
||||
sidebar_label: 企业微信应用告警通知
|
||||
sidebar_label: 告警企业微信应用通知
|
||||
keywords: [开源告警系统, 开源监控告警系统, 企业微信应用告警通知]
|
||||
---
|
||||
|
||||
|
||||
@@ -1,55 +1,43 @@
|
||||
---
|
||||
id: alert_threshold
|
||||
title: 阈值告警配置
|
||||
sidebar_label: 阈值告警配置
|
||||
title: 告警阈值规则配置
|
||||
sidebar_label: 阈值规则
|
||||
---
|
||||
|
||||
> 对监控指标配置告警阈值(警告告警,严重告警,紧急告警),系统根据阈值配置和采集指标数据计算触发告警。
|
||||
|
||||
## 操作步骤
|
||||
|
||||
### 1. 监控服务设置标签(可选)
|
||||
|
||||
如果您需要对告警进行分类,可以对监控的目标设置标签。如:您有多个Linux系统需要监控,并且每个系统监控指标不同,比如:A服务器可用内存大于1G,B服务器可用内存大于2G,那么您可以为A服务器和B服务器分别设置标签,然后针对标签进行告警配置。
|
||||
|
||||
#### 创建标签
|
||||
|
||||
依次点击 **标签管理 -> 新增标签**
|
||||
|
||||

|
||||
|
||||
如上图所示,新增标签,这里我们设置标签为: linux:dev (开发环境使用Linux)
|
||||
|
||||
#### 配置标签
|
||||
|
||||
TODO 图片名称更新
|
||||

|
||||
|
||||
如上图所示,我们点击`新增标签`
|
||||
|
||||

|
||||
|
||||
选择我们的标签,这里演示选择`linux:dev`标签
|
||||
|
||||
### 创建阈值规则
|
||||
|
||||
依次点击 **【阈值规则】->【新增阈值规则】-> 【配置后确定】**
|
||||
:::tip
|
||||
告警阈值规则是 `HertzBeat` 的核心功能,用户可以通过阈值规则来配置告警的触发条件。
|
||||
阈值规则支持实时阈值和计划阈值,实时阈值可以在监控数据采集时直接触发告警,计划阈值支持 PromQL 等表达式在指定时间段内计算触发告警。
|
||||
支持可视化页面配置或更高灵活性的表达式规则配置,支持配置触发次数,告警级别,通知模版,关联指定监控等。
|
||||
:::
|
||||
|
||||

|
||||
|
||||
上图配置具体说明:
|
||||
## 实时阈值
|
||||
|
||||
- **指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> summary指标集合下的 -> responseTime响应时间指标
|
||||
- **阈值规则**:根据此表达式来计算判断是否触发阈值,表达式环境变量和操作符见页面提示,例如:设置响应时间大于50触发告警,表达式为 `responseTime > 50`。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr)
|
||||
> 实时阈值是指在监控数据采集时直接触发告警,适用于对实时性要求较高的场景。
|
||||
|
||||
### 创建实时阈值规则
|
||||
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 -> 新增实时阈值规则
|
||||
|
||||
配置阈值,例如: 选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
|
||||
|
||||

|
||||
|
||||
配置项说明:
|
||||
|
||||
- **阈值名称**:定义此阈值规则的唯一名称
|
||||
- **指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> 响应时间指标
|
||||
- **阈值规则**:配置具体指标的告警触发规则,支持图形界面和表达式规则,表达式环境变量和操作符见页面提示。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr)
|
||||
- **关联监控**:应用此阈值规则到指定的监控对象(支持直接绑定和标签关联),若未配置,则应用到所有符合此阈值类型规则的监控对象上。
|
||||
- **告警级别**:触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency
|
||||
- **触发次数**:设置触发阈值多少次之后才会真正的触发告警
|
||||
- **通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${app}.${metrics}.${metric}指标的值为${responseTime},大于50触发告警`
|
||||
- **绑定标签**:选择我们需要应用的标签,如果不选择标签则会应用到设置指标对象对应的所有服务上。
|
||||
- **应用全局**:设置此阈值是否对全局的此类指标都应用有效,默认否。新增阈值后还需将阈值与监控对象关联,这样阈值才会对此监控生效。
|
||||
- **恢复通知**:告警触发后是否发送恢复通知,默认不发送。
|
||||
- **通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${__instancename__} ${__metric__} 指标的值为 ${responseTime},大于 50 触发告警`
|
||||
- **附加标签**:给此阈值规则附加标签,当产生告警时,此标签也会附加到告警上。
|
||||
- **附加声明**:给此阈值规则附加声明信息(声明内容支持环境变量),当产生告警时,此声明信息会被渲染并附加到告警上。
|
||||
- **启用告警**:此告警阈值配置开启生效或关闭
|
||||
|
||||
**阈值告警配置完毕,已经被成功触发的告警信息可以在【告警中心】看到。**
|
||||
**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【告警通知】配置。**
|
||||
**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【消息通知】配置。**
|
||||
|
||||
其它问题可以通过交流群ISSUE反馈哦!
|
||||
## 计划阈值
|
||||
|
||||
@@ -7,14 +7,7 @@ slug: /
|
||||
|
||||
> 实时监控系统,无需Agent,性能集群,兼容Prometheus,自定义监控和状态页构建能力。
|
||||
|
||||
[](https://discord.gg/Fb6M73htGr)
|
||||
[](https://www.reddit.com/r/hertzbeat/)
|
||||
[](https://x.com/hertzbeat1024)
|
||||
[](https://www.bestpractices.dev/projects/8139)
|
||||
[](https://hub.docker.com/r/apache/hertzbeat)
|
||||
[](https://artifacthub.io/packages/search?repo=hertzbeat)
|
||||
[](https://qm.qq.com/q/FltGGGIX2m)
|
||||
[](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow)
|
||||
**官网: [hertzbeat.apache.org](https://hertzbeat.apache.org)**
|
||||
|
||||
## 🎡 <font color="green">介绍</font>
|
||||
|
||||
@@ -90,9 +83,9 @@ HertzBeat 使用这些已有的标准协议或规范,将他们抽象规范可
|
||||
- 和更多自定义监控模版。
|
||||
- 通知支持 `Discord` `Slack` `Telegram` `邮件` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱`。
|
||||
|
||||
### 强大自定义功能
|
||||
### 自定义能力
|
||||
|
||||
> 由前面的**监控模版**介绍,大概清楚了 `HertzBeat` 拥有的强大自定义功能。
|
||||
> 由前面的**监控模版**介绍,大概清楚了 `HertzBeat` 拥有的自定义功能。
|
||||
> 我们将每个监控类型都视为一个监控模版,不管是官方内置的还是后期用户自定义新增的。用户都可以方便的通过修改监控模版来新增修改删除监控指标。
|
||||
> 模版里面包含各个协议的使用配置,环境变量,指标转换,指标计算,单位转换,指标采集等一系列功能,帮助用户能采集到自己想要的监控指标。
|
||||
|
||||
@@ -170,7 +163,7 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||
- 全局概览页面,分类展示了当前监控大类别数量分布,用户可直观查看当前的监控类型与数量并点击跳转至对应监控类型进行维护管理。
|
||||
- 展示当前注册的采集器集群状态,包括采集器的上线状态,监控任务,启动时间,IP地址,名称等。
|
||||
- 下发展示了最近告警信息列表,告警级别分布情况,告警处理率情况。
|
||||
- 下发展示了最近告警信息列表,告警级别分布情况等。
|
||||
|
||||

|
||||
|
||||
@@ -221,7 +214,7 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||

|
||||
|
||||
### 新增修改监控
|
||||
### 新增监控
|
||||
|
||||
- 新增或修改指定监控类型的监控实例,配置对端监控的IP,端口等参数,设置采集周期,采集任务调度方式,支持提前探测可用性等。
|
||||
- 页面上配置的监控参数由对应监控类型的监控模版所定义,用户可以通过修改监控模版来修改页面配置参数。
|
||||
@@ -234,7 +227,7 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
- 监控的数据详情页面,展示了当前监控的基本参数信息,监控指标数据信息。
|
||||
- 监控实时数据报告,以小卡片列表的形式展示了当前监控的所有指标实时值,用户可根据实时值参考配置告警阈值规则。
|
||||
- 监控历史数据报告,以趋势图表的形式展示了当前监控数值类型的指标的历史值,支持查询小时,天,月的历史数据,支持配置页面刷新时间。
|
||||
- ⚠️注意监控历史图表需配置外置时序数据库才能获取完整功能,时序数据库支持: IOTDB, TDengine, InfluxDB, GreptimeDB
|
||||
- ⚠️注意监控历史图表需配置外置时序数据库才能获取完整功能。
|
||||
|
||||

|
||||
|
||||
@@ -249,22 +242,32 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||
### 阈值规则
|
||||
|
||||
- 对于监控的可用性状态设置阈值规则,特定指标的值超过我们预期范围时发出告警,这些都可以在阈值规则这里配置。
|
||||
- 告警级别分为三级:通知告警,严重告警,紧急告警。
|
||||
- 阈值规则支持可视化页面配置或表达式规则配置,灵活性更高。
|
||||
- 支持配置触发次数,告警级别,通知模版,关联指定监控等。
|
||||
- 告警阈值规则是 `HertzBeat` 的核心功能,用户可以通过阈值规则来配置告警的触发条件。
|
||||
- 阈值规则支持实时阈值和计划阈值,实时阈值可以在监控数据采集时直接触发告警,计划阈值支持 PromQL 等表达式在指定时间段内计算触发告警。
|
||||
- 阈值规则支持可视化页面配置或更高灵活性的表达式规则配置,支持配置触发次数,告警级别,通知模版,关联指定监控等。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 告警集成
|
||||
|
||||
- 统一管理不同第三方平台告警,集成接入第三方监控观测系统的告警消息,对其进行分组,收敛,抑制,静默,分发通知等。
|
||||
|
||||

|
||||
|
||||
### 告警收敛
|
||||
### 告警分组
|
||||
|
||||
- 当通过阈值规则判断触发告警后,会进入到告警收敛,告警收敛会根据规则对特定时间段的重复告警消息去重收敛,已避免大量重复性告警导致接收人告警麻木。
|
||||
- 告警收敛规则支持重复告警生效时间段,标签匹配和告警级别匹配过滤。
|
||||
- 分组收敛支持对指定分组标签的告警进行分组合并,对时间段的相同重复告警去重收敛。
|
||||
- 当阈值规则触发告警或外部告警上报后,会进入到分组收敛进行告警分组,告警去重,以避免大量告警消息导致告警风暴。
|
||||
|
||||

|
||||
|
||||
### 告警抑制
|
||||
|
||||
- 告警抑制用于配置告警之间的抑制关系,比如同一实例下高级别告警抑制低级别告警。
|
||||
- 当某个告警发生时,可以抑制其他告警的产生。例如,当服务器宕机时,可以抑制该服务器上的所有告警。
|
||||
|
||||

|
||||
|
||||
### 告警静默
|
||||
@@ -273,8 +276,6 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
- 此应用场景如用户在系统维护中,无需发已知告警。用户在工作日时间才会接收告警消息,用户在晚上需避免打扰等。
|
||||
- 告警静默规则支持一次性时间段或周期性时间段,支持标签匹配和告警级别匹配。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 消息通知
|
||||
@@ -291,6 +292,8 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 监控模版
|
||||
|
||||
- HertzBeat 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗?
|
||||
@@ -298,10 +301,29 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||

|
||||
|
||||
### 采集集群
|
||||
|
||||
- 用户可以通过配置采集器集群来实现对大规模监控任务的分布式采集。
|
||||
- 采集器集群支持多节点部署,支持自动负载均衡,自动故障转移等。
|
||||
- 支持多隔离网络的统一管理,云边协同。
|
||||
|
||||

|
||||
|
||||
### 状态页面
|
||||
|
||||
- 基于 HertzBeat 快速构建自己产品的对外状态页,轻松向用户传达您产品服务的实时状态。例如 Github 提供的服务状态页 <https://www.githubstatus.com>。
|
||||
- 支持状态页组件状态和监控状态联动同步,故障事件维护管理机制等。提高您的透明度,专业度和用户信任,降低沟通成本。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
**还有更多强大的功能快去探索呀。Have Fun!**
|
||||
**更多功能欢迎探索呀。Have Fun!**
|
||||
|
||||
---
|
||||
|
||||
**Github: <https://github.com/apache/hertzbeat>**
|
||||
|
||||
**Home: <https://hertzbeat.apache.org/>**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: 1.6.0-update
|
||||
title: 如何升级到1.6.0
|
||||
sidebar_label: 1.6.0升级指南
|
||||
title: 如何升级到 1.6.0
|
||||
sidebar_label: 1.6.0 升级指南
|
||||
---
|
||||
|
||||
## HertzBeat 1.6.0 升级指南
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
id: 1.7.0-update
|
||||
title: 如何升级到 1.7.0
|
||||
sidebar_label: 1.7.0 升级指南
|
||||
---
|
||||
|
||||
## HertzBeat 1.7.0 升级指南
|
||||
|
||||
:::note
|
||||
该指南适用于 1.6.x 向1.6.0 版本升级 1.7.0
|
||||
如果你使用更老的版本,建议使用导出功能重新安装,或先升级到 1.6.0 再按本指南升级到 1.7.0
|
||||
:::
|
||||
|
||||
其它请参考 [版本更新指引](upgrade)
|
||||
|
||||
## 升级注意
|
||||
|
||||
### 变更数据库
|
||||
|
||||
在 1.7.0 中,我们使用 `label` 代替 `tag`,在某些环境中,我们需要删除数据库中的表 `hzb_tag_monitor_bind`。
|
||||
|
||||
```sql
|
||||
DELETE FROM hzb_tag_monitor_bind;
|
||||
```
|
||||
|
||||
### 更新告警阈值
|
||||
|
||||
在 1.7.0 中,我们重新设计了新的告警阈值,包括实时阈值和计划阈值。
|
||||
我们需要手动重新配置告警阈值和告警分组。
|
||||
|
||||
:::tip
|
||||
新版本没有内置的默认阈值规则,比如之前的可用性阈值。
|
||||
如果您发现监控下线后没有告警,您需要自己配置相应的可用性阈值。
|
||||
:::
|
||||
|
||||
## 通过导出导入升级
|
||||
|
||||
若不想如上繁琐的脚本升级方式,可以直接将老环境的监控任务导出导入。
|
||||
|
||||
- 部署一套最新版本的新环境
|
||||
- 在页面上将老环境的监控任务导出再导入
|
||||
@@ -1,40 +1,44 @@
|
||||
---
|
||||
id: ssl-cert-practice
|
||||
title: SSL证书过期监控使用案例
|
||||
sidebar_label: SSL证书过期监控使用案例
|
||||
title: SSL 证书过期监控案例
|
||||
sidebar_label: SSL 证书过期监控案例
|
||||
---
|
||||
|
||||
:::tip
|
||||
现在大部分网站都默认支持 HTTPS,我们申请的证书一般是3个月或者1年,很容易随着时间的流逝SSL证书过期了我们却没有第一时间发现,或者在过期之前没有及时更新证书。
|
||||
:::
|
||||
|
||||
这篇文章介绍如果使用 hertzbeat 监控系统来检测我们网站的SSL证书有效期,当证书过期时或证书快过期前几天,给我们发告警消息。
|
||||
|
||||
#### HertzBeat 是什么
|
||||
## HertzBeat 是什么
|
||||
|
||||
Apache HertzBeat (incubating) 一个拥有强大自定义监控能力,无需Agent的实时监控工具。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。
|
||||
|
||||
github: <https://github.com/apache/hertzbeat>
|
||||
|
||||
#### 安装 HertzBeat
|
||||
## 安装 HertzBeat
|
||||
|
||||
1. `docker` 环境仅需一条命令即可安装
|
||||
|
||||
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
|
||||
`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
|
||||
|
||||
2. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
|
||||
|
||||
#### 监控SSL证书
|
||||
:::note
|
||||
生产环境建议完整部署方式, 参考 <https://hertzbeat.apache.org/docs/start/docker-compose-deploy>
|
||||
:::
|
||||
|
||||
1. 点击新增SSL证书监控
|
||||
## 监控 SSL 证书
|
||||
|
||||
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
|
||||
1. 新增 SSL 证书监控
|
||||
|
||||
> 系统页面 -> 监控菜单 -> 新增监控 -> 服务监控 -> SSL 证书 -> 新增 SSL 证书
|
||||
|
||||

|
||||
|
||||
2. 配置监控网站
|
||||
|
||||
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
|
||||
>
|
||||
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
|
||||
|
||||

|
||||
|
||||
@@ -44,52 +48,46 @@ github: <https://github.com/apache/hertzbeat>
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
4. 设置阈值(证书过期时触发)
|
||||
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
|
||||
|
||||

|
||||
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 -> 新增实时阈值规则
|
||||
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
|
||||
|
||||

|
||||
|
||||
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
|
||||
|
||||

|
||||
> 阈值规则还有其它功能可以配置, 比如阈值关联指定监控, 触发次数, 关联标签等等。
|
||||
|
||||
5. 设置阈值(证书过期前一周触发)
|
||||
|
||||
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
|
||||
> 同理如上,选择代码阈值规则,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
|
||||
|
||||

|
||||

|
||||
|
||||
> 最终可以在告警中心看到已触发的告警。
|
||||
|
||||

|
||||

|
||||
|
||||
6. 告警通知(通过钉钉微信飞书等及时通知)
|
||||
|
||||
> 监控系统 -> 告警通知 -> 新增接收人
|
||||
> 系统页面 -> 消息通知 -> 通知媒介 -> 新增接收对象
|
||||
|
||||

|
||||

|
||||
|
||||
钉钉微信飞书等token配置可以参考帮助文档
|
||||
钉钉微信飞书等 token 配置可以参考帮助文档
|
||||
|
||||
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
|
||||
<https://tancloud.cn/docs/help/alert_dingtalk>
|
||||
<https://hertzbeat.apache.org/docs/help/alert_feishu>
|
||||
|
||||
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
|
||||
> 消息通知 -> 通知策略 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
|
||||
|
||||

|
||||

|
||||
|
||||
7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。
|
||||
|
||||
----
|
||||
|
||||
#### 完
|
||||
## 结束搞定
|
||||
|
||||
监控SSL证书的实践就到这里,当然对hertzbeat来说这个功能只是冰山一角,如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯!
|
||||
|
||||
@@ -1,55 +1,43 @@
|
||||
---
|
||||
id: alert_threshold
|
||||
title: 阈值告警配置
|
||||
sidebar_label: 阈值告警配置
|
||||
id: alert_threshold
|
||||
title: 告警阈值规则配置
|
||||
sidebar_label: 阈值规则
|
||||
---
|
||||
|
||||
> 对监控指标配置告警阈值(警告告警,严重告警,紧急告警),系统根据阈值配置和采集指标数据计算触发告警。
|
||||
|
||||
## 操作步骤
|
||||
|
||||
### 1. 监控服务设置标签(可选)
|
||||
|
||||
如果您需要对告警进行分类,可以对监控的目标设置标签。如:您有多个Linux系统需要监控,并且每个系统监控指标不同,比如:A服务器可用内存大于1G,B服务器可用内存大于2G,那么您可以为A服务器和B服务器分别设置标签,然后针对标签进行告警配置。
|
||||
|
||||
#### 创建标签
|
||||
|
||||
依次点击 **标签管理 -> 新增标签**
|
||||
|
||||

|
||||
|
||||
如上图所示,新增标签,这里我们设置标签为: linux:dev (开发环境使用Linux)
|
||||
|
||||
#### 配置标签
|
||||
|
||||
TODO 图片名称更新
|
||||

|
||||
|
||||
如上图所示,我们点击`新增标签`
|
||||
|
||||

|
||||
|
||||
选择我们的标签,这里演示选择`linux:dev`标签
|
||||
|
||||
### 创建阈值规则
|
||||
|
||||
依次点击 **【阈值规则】->【新增阈值规则】-> 【配置后确定】**
|
||||
:::tip
|
||||
告警阈值规则是 `HertzBeat` 的核心功能,用户可以通过阈值规则来配置告警的触发条件。
|
||||
阈值规则支持实时阈值和计划阈值,实时阈值可以在监控数据采集时直接触发告警,计划阈值支持 PromQL 等表达式在指定时间段内计算触发告警。
|
||||
支持可视化页面配置或更高灵活性的表达式规则配置,支持配置触发次数,告警级别,通知模版,关联指定监控等。
|
||||
:::
|
||||
|
||||

|
||||
|
||||
上图配置具体说明:
|
||||
## 实时阈值
|
||||
|
||||
- **指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> summary指标集合下的 -> responseTime响应时间指标
|
||||
- **阈值规则**:根据此表达式来计算判断是否触发阈值,表达式环境变量和操作符见页面提示,例如:设置响应时间大于50触发告警,表达式为 `responseTime > 50`。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr)
|
||||
> 实时阈值是指在监控数据采集时直接触发告警,适用于对实时性要求较高的场景。
|
||||
|
||||
### 创建实时阈值规则
|
||||
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 -> 新增实时阈值规则
|
||||
|
||||
配置阈值,例如: 选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
|
||||
|
||||

|
||||
|
||||
配置项说明:
|
||||
|
||||
- **阈值名称**:定义此阈值规则的唯一名称
|
||||
- **指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> 响应时间指标
|
||||
- **阈值规则**:配置具体指标的告警触发规则,支持图形界面和表达式规则,表达式环境变量和操作符见页面提示。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr)
|
||||
- **关联监控**:应用此阈值规则到指定的监控对象(支持直接绑定和标签关联),若未配置,则应用到所有符合此阈值类型规则的监控对象上。
|
||||
- **告警级别**:触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency
|
||||
- **触发次数**:设置触发阈值多少次之后才会真正的触发告警
|
||||
- **通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${app}.${metrics}.${metric}指标的值为${responseTime},大于50触发告警`
|
||||
- **绑定标签**:选择我们需要应用的标签,如果不选择标签则会应用到设置指标对象对应的所有服务上。
|
||||
- **应用全局**:设置此阈值是否对全局的此类指标都应用有效,默认否。新增阈值后还需将阈值与监控对象关联,这样阈值才会对此监控生效。
|
||||
- **恢复通知**:告警触发后是否发送恢复通知,默认不发送。
|
||||
- **通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${__instancename__} ${__metric__} 指标的值为 ${responseTime},大于 50 触发告警`
|
||||
- **附加标签**:给此阈值规则附加标签,当产生告警时,此标签也会附加到告警上。
|
||||
- **附加声明**:给此阈值规则附加声明信息(声明内容支持环境变量),当产生告警时,此声明信息会被渲染并附加到告警上。
|
||||
- **启用告警**:此告警阈值配置开启生效或关闭
|
||||
|
||||
**阈值告警配置完毕,已经被成功触发的告警信息可以在【告警中心】看到。**
|
||||
**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【告警通知】配置。**
|
||||
**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【消息通知】配置。**
|
||||
|
||||
其它问题可以通过交流群ISSUE反馈哦!
|
||||
## 计划阈值
|
||||
|
||||
@@ -256,7 +256,7 @@ Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### 告警收敛
|
||||
|
||||
|
||||
@@ -1,95 +1,93 @@
|
||||
---
|
||||
id: ssl-cert-practice
|
||||
title: SSL证书过期监控使用案例
|
||||
id: ssl-cert-practice
|
||||
title: SSL证书过期监控使用案例
|
||||
sidebar_label: SSL证书过期监控使用案例
|
||||
---
|
||||
|
||||
:::tip
|
||||
现在大部分网站都默认支持 HTTPS,我们申请的证书一般是3个月或者1年,很容易随着时间的流逝SSL证书过期了我们却没有第一时间发现,或者在过期之前没有及时更新证书。
|
||||
:::
|
||||
|
||||
这篇文章介绍如果使用 hertzbeat 监控系统来检测我们网站的SSL证书有效期,当证书过期时或证书快过期前几天,给我们发告警消息。
|
||||
|
||||
#### HertzBeat 是什么
|
||||
## HertzBeat 是什么
|
||||
|
||||
Apache HertzBeat (incubating) 一个拥有强大自定义监控能力,无需Agent的实时监控工具。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。
|
||||
|
||||
github: <https://github.com/apache/hertzbeat>
|
||||
|
||||
#### 安装 HertzBeat
|
||||
## 安装 HertzBeat
|
||||
|
||||
1. `docker` 环境仅需一条命令即可安装
|
||||
|
||||
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
|
||||
`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
|
||||
|
||||
2. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat`
|
||||
|
||||
#### 监控SSL证书
|
||||
:::note
|
||||
生产环境建议完整部署方式, 参考 <https://hertzbeat.apache.org/docs/start/docker-compose-deploy>
|
||||
:::
|
||||
|
||||
1. 点击新增SSL证书监控
|
||||
## 监控 SSL 证书
|
||||
|
||||
> 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书
|
||||
1. 新增 SSL 证书监控
|
||||
|
||||

|
||||
> 系统页面 -> 监控菜单 -> 新增监控 -> 服务监控 -> SSL 证书 -> 新增 SSL 证书
|
||||
|
||||

|
||||
|
||||
2. 配置监控网站
|
||||
|
||||
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
|
||||
>
|
||||
> 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。
|
||||
> 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。
|
||||
|
||||

|
||||

|
||||
|
||||
3. 查看检测指标数据
|
||||
|
||||
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
|
||||
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
4. 设置阈值(证书过期时触发)
|
||||
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值
|
||||
> 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 -> 新增实时阈值规则
|
||||
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
|
||||
|
||||

|
||||

|
||||
|
||||
> 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。
|
||||
|
||||

|
||||
|
||||
> 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。
|
||||
|
||||

|
||||
> 阈值规则还有其它功能可以配置, 比如阈值关联指定监控, 触发次数, 关联标签等等。
|
||||
|
||||
5. 设置阈值(证书过期前一周触发)
|
||||
|
||||
> 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
|
||||
> 同理如上,选择代码阈值规则,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。
|
||||
|
||||

|
||||

|
||||
|
||||
> 最终可以在告警中心看到已触发的告警。
|
||||
> 最终可以在告警中心看到已触发的告警。
|
||||
|
||||

|
||||

|
||||
|
||||
6. 告警通知(通过钉钉微信飞书等及时通知)
|
||||
|
||||
> 监控系统 -> 告警通知 -> 新增接收人
|
||||
> 系统页面 -> 消息通知 -> 通知媒介 -> 新增接收对象
|
||||
|
||||

|
||||

|
||||
|
||||
钉钉微信飞书等token配置可以参考帮助文档
|
||||
钉钉微信飞书等 token 配置可以参考帮助文档
|
||||
|
||||
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
|
||||
<https://tancloud.cn/docs/help/alert_dingtalk>
|
||||
<https://hertzbeat.apache.org/docs/help/alert_feishu>
|
||||
|
||||
> 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
|
||||
> 消息通知 -> 通知策略 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知
|
||||
|
||||

|
||||

|
||||
|
||||
7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。
|
||||
|
||||
----
|
||||
|
||||
#### 完
|
||||
## 结束搞定
|
||||
|
||||
监控SSL证书的实践就到这里,当然对hertzbeat来说这个功能只是冰山一角,如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯!
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
{
|
||||
"type": "category",
|
||||
"label": "upgrade",
|
||||
"items": ["start/1.6.0-update", "start/upgrade"]
|
||||
"items": ["start/1.7.0-update","start/1.6.0-update", "start/upgrade"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
@@ -51,7 +51,7 @@
|
||||
{
|
||||
"type": "category",
|
||||
"label": "use-case",
|
||||
"items": ["start/ssl-cert-practice"]
|
||||
"items": ["start/usecase/ssl-cert-practice"]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -61,6 +61,41 @@
|
||||
"items": [
|
||||
"help/guide",
|
||||
"help/security_model",
|
||||
{
|
||||
"type": "category",
|
||||
"label": "use-case",
|
||||
"items": ["start/usecase/ssl-cert-practice"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "alert",
|
||||
"items": [
|
||||
"help/alarm_center",
|
||||
"help/alert_threshold",
|
||||
"help/alert_threshold_expr",
|
||||
"help/alarm_group",
|
||||
"help/alarm_inhibit",
|
||||
"help/alarm_silence"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "notice",
|
||||
"items": [
|
||||
"help/alert_email",
|
||||
"help/alert_sms",
|
||||
"help/alert_webhook",
|
||||
"help/alert_discord",
|
||||
"help/alert_slack",
|
||||
"help/alert_telegram",
|
||||
"help/alert_wework",
|
||||
"help/alert_dingtalk",
|
||||
"help/alert_feishu",
|
||||
"help/alert_console",
|
||||
"help/alert_enterprise_wechat_app",
|
||||
"help/alert_smn"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "service",
|
||||
@@ -214,54 +249,20 @@
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "aiConfig",
|
||||
"items": ["help/aiConfig"]
|
||||
"label": "network",
|
||||
"items": ["help/huawei_switch"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "custom",
|
||||
"items": ["help/kafka_promql", "help/influxdb_promql"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "network",
|
||||
"items": ["help/huawei_switch"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "threshold",
|
||||
"items": ["help/alert_threshold", "help/alert_threshold_expr"]
|
||||
},
|
||||
{
|
||||
"type": "category",
|
||||
"label": "reduce",
|
||||
"items": ["help/alarm_group","help/alarm_inhibit"]
|
||||
},
|
||||
"help/alarm_silence",
|
||||
{
|
||||
"type": "category",
|
||||
"label": "notice",
|
||||
"items": [
|
||||
"help/alert_email",
|
||||
"help/alert_sms",
|
||||
"help/alert_webhook",
|
||||
"help/alert_discord",
|
||||
"help/alert_slack",
|
||||
"help/alert_telegram",
|
||||
"help/alert_wework",
|
||||
"help/alert_dingtalk",
|
||||
"help/alert_feishu",
|
||||
"help/alert_console",
|
||||
"help/alert_enterprise_wechat_app",
|
||||
"help/alert_smn"
|
||||
]
|
||||
},
|
||||
"help/bulletin",
|
||||
"help/plugin",
|
||||
"help/time_expression",
|
||||
"help/grafana_dashboard",
|
||||
"help/collector",
|
||||
"help/alarm_center",
|
||||
"help/ai_config",
|
||||
"help/issue"
|
||||
]
|
||||
},
|
||||
|
||||
|
Before Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 251 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 172 KiB |
|
After Width: | Height: | Size: 163 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 177 KiB |
|
Before Width: | Height: | Size: 194 KiB |
|
Before Width: | Height: | Size: 271 KiB |
|
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 220 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 1014 KiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 334 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 206 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
@@ -1,55 +1,43 @@
|
||||
---
|
||||
id: alert_threshold
|
||||
title: Threshold Alert Configuration
|
||||
sidebar_label: Threshold Alert Configuration
|
||||
title: Alarm Threshold Configuration
|
||||
sidebar_label: Alarm Threshold
|
||||
---
|
||||
|
||||
> Configure alert thresholds for monitoring metrics (warning alert, critical alert, emergency alert). The system triggers alerts based on threshold configuration and collected metric data.
|
||||
:::tip
|
||||
Alarm Threshold are the core function of `HertzBeat`, users can configure the trigger conditions of the alarm through the threshold rules.
|
||||
Support real-time threshold and scheduled threshold, real-time threshold can directly trigger the alarm when monitoring data is collected, scheduled threshold supports PromQL and other expressions to calculate the trigger alarm within a specified time period.
|
||||
Support visual page configuration or more flexible expression rule configuration, support configuring trigger times, alarm levels, notification templates, associated specified monitoring and so on.
|
||||
:::
|
||||
|
||||
## Operational Steps
|
||||

|
||||
|
||||
### 1. Setting Labels for Monitoring Services (Optional)
|
||||
## Real-time Threshold
|
||||
|
||||
If you need to categorize alerts, you can set labels for the monitored targets. For example: If you have multiple Linux systems to monitor, and each system has different monitoring metrics, such as: Server A has available memory greater than 1G, Server B has available memory greater than 2G, then you can set labels for Server A and Server B respectively, and then configure alerts based on these labels.
|
||||
|
||||
#### Creating Labels
|
||||
|
||||
Navigate to **Label Management -> Add Label**
|
||||
|
||||

|
||||
|
||||
As shown in the image above, add a new label. Here we set the label as: linux:dev (Linux used in development environment).
|
||||
|
||||
#### Configuring Labels
|
||||
|
||||
TODO Update image name
|
||||

|
||||
|
||||
As shown in the image above, click on `Add Label`.
|
||||
|
||||

|
||||
|
||||
Select our label, here demonstrated as selecting the `linux:dev` label.
|
||||
> Real-time threshold means that the alarm is triggered directly when the monitoring data is collected, which is suitable for scenarios with high real-time requirements.
|
||||
|
||||
### Creating Threshold Rules
|
||||
|
||||
Navigate to **[Threshold Rules] -> [Add Threshold Rule] -> [Confirm Configuration]**
|
||||
> HertzBeat Page -> Alerting -> Threshold -> New Threshold -> ReadTime Threshold Rule
|
||||
|
||||

|
||||
Configure the threshold, for example: Select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
|
||||
|
||||
The above image explains the configuration details:
|
||||

|
||||
|
||||
Configuration item details:
|
||||
|
||||
- **Rule Name**:Unique name defining this threshold rule
|
||||
- **Metric Object**: Select the monitoring metric object for which we need to configure the threshold. For example: Under website monitoring type -> under the summary metric set -> responseTime metric.
|
||||
- **Threshold Rule**: Use this expression to calculate whether to trigger the threshold. Expression variables and operators are provided on the page for reference. For example: Set an alert to trigger if response time is greater than 50, the expression would be `responseTime > 50`. For detailed help on threshold expressions, see [Threshold Expression Help](alert_threshold_expr).
|
||||
- **Threshold Rule**: Configure the alarm trigger rules for specific indicators, support graphical interface and expression rules. For expression environment variables and operators, see the page prompts. For detailed help on threshold expressions, see [Threshold Expression Help](alert_threshold_expr).
|
||||
- **Associated Monitors**:Apply this threshold rule to the specified monitoring object (support direct binding and label association). If not configured, it will be applied to all monitoring objects that meet this threshold type rule.
|
||||
- **Alert Level**: The alert level triggered by the threshold, from low to high: warning, critical, emergency.
|
||||
- **Trigger Count**: Set how many times the threshold must be triggered before the alert is actually triggered.
|
||||
- **Notification Template**: The template for the notification message sent after the alert is triggered. Template variables are provided on the page. For example: `${app}.${metrics}.${metric} metric value is ${responseTime}, which is greater than 50 triggering the alert`.
|
||||
- **Bind Label**: Select the label we need to apply. If no label is selected, it will apply to all services corresponding to the set metric object.
|
||||
- **Apply Globally**: Set whether this threshold applies globally to all such metrics, default is no. After adding a threshold, it needs to be associated with the monitoring object for the threshold to take effect.
|
||||
- **Recovery Notification**: Whether to send a recovery notification after the alert is triggered, default is not to send.
|
||||
- **Bing Annotation**:Add annotation information to this threshold rule (the annotation content supports environment variables). When an alarm is generated, this annotation information will be rendered and attached to the alarm.
|
||||
- **Enable Alert**: Enable or disable this alert threshold configuration.
|
||||
|
||||
**The threshold alert configuration is complete, and alerts that have been successfully triggered can be viewed in the [Alert Center].**
|
||||
**If you need to send alert notifications via email, WeChat, DingTalk, or Feishu, you can configure it in [Alert Notifications].**
|
||||
**The threshold alert configuration is complete, and alerts that have been successfully triggered can be viewed in the [Alarm Center].**
|
||||
**If you need to send alert notifications via email, WeChat, DingTalk, or Feishu, you can configure it in [Notification].**
|
||||
|
||||
For other issues, you can provide feedback through the community chat group or issue tracker!
|
||||
## Scheduled Threshold
|
||||
|
||||
@@ -257,7 +257,7 @@ Built-in support for monitoring types include:
|
||||
|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
### Alarm Convergence
|
||||
|
||||
|
||||
@@ -1,93 +1,92 @@
|
||||
---
|
||||
id: ssl-cert-practice
|
||||
title: SSL Certificate Monitor Practice
|
||||
sidebar_label: SSL Certificate Monitor Practice
|
||||
title: SSL Certificate Monitoring Practice
|
||||
sidebar_label: SSL Certificate Monitoring Practice
|
||||
---
|
||||
|
||||
:::tip
|
||||
Most websites now support HTTPS by default. The certificate we apply for is usually 3 months or 1 year. It is easy to expire the SSL certificate over time, but we did not find it the first time, or did not update the certificate in time before it expired.
|
||||
:::
|
||||
|
||||
This article introduces how to use the hertzbeat monitoring tool to detect the validity period of our website's SSL certificate, and send us a warning message when the certificate expires or a few days before the certificate expires.
|
||||
|
||||
#### What is HertzBeat
|
||||
## What is HertzBeat
|
||||
|
||||
Apache HertzBeat (incubating) is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu).
|
||||
|
||||
github: <https://github.com/apache/hertzbeat>
|
||||
|
||||
#### Install HertzBeat
|
||||
## Install HertzBeat
|
||||
|
||||
1. The `docker` environment can be installed with just one command
|
||||
|
||||
`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat`
|
||||
`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat`
|
||||
|
||||
2. After the installation is successful, the browser can access `localhost:1157` to start, the default account password is `admin/hertzbeat`
|
||||
|
||||
#### Monitoring SSL certificates
|
||||
The production environment recommends a complete deployment method, refer <https://hertzbeat.apache.org/docs/start/docker-compose-deploy>
|
||||
|
||||
## Monitoring SSL Certificates
|
||||
|
||||
1. Click Add SSL Certificate Monitor
|
||||
|
||||
> System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate
|
||||
> HertzBeat Page -> Monitors Menu -> New Monitor -> Service Monitor -> Add SSL Certificate
|
||||
|
||||

|
||||

|
||||
|
||||
2. Configure the monitoring website
|
||||
|
||||
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
|
||||
> Click OK Note ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button.
|
||||
> Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc.
|
||||
> Click OK Note
|
||||
|
||||

|
||||

|
||||
|
||||
3. View the detection index data
|
||||
|
||||
> In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the metric data chart, etc.
|
||||
> In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the metric data chart, etc.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
4. Set the threshold (triggered when the certificate expires)
|
||||
|
||||
> System Page -> Alarms -> Alarm Thresholds -> New Thresholds
|
||||
> HertzBeat Page -> Alerting -> Threshold -> New Threshold -> ReadTime Threshold Rule
|
||||
> Configure the threshold, select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
|
||||
|
||||

|
||||

|
||||
|
||||
> Configure the threshold, select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc.
|
||||
|
||||

|
||||
|
||||
> Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to.
|
||||
|
||||

|
||||
> Threshold rule has others function you can try eg: associating thresholds with monitoring, trigger times so on.
|
||||
|
||||
5. Set the threshold (triggered one week before the certificate expires)
|
||||
|
||||
> In the same way, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now( ) + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds.
|
||||
> In the same way, switch coding threshold, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now() + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds.
|
||||
|
||||

|
||||

|
||||
|
||||
> Finally, you can see the triggered alarm in the alarm center.
|
||||
> Finally, you can see the triggered alarm in the alarm center.
|
||||
|
||||

|
||||

|
||||
|
||||
6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.)
|
||||
|
||||
> Monitoring Tool -> Alarm Notification -> New Receiver
|
||||
> HertzBeat Page -> Notification -> Notice Receiver -> New Receiver -> Config the Feishu Receiver
|
||||
|
||||

|
||||

|
||||
|
||||
For token configuration such as Dingding WeChat Feishu, please refer to the help document
|
||||
For token configuration such as Feishu, please refer to the help document
|
||||
|
||||
<https://hertzbeat.apache.org/docs/help/alert_dingtalk>
|
||||
<https://hertzbeat.apache.org/docs/help/alert_feishu>
|
||||
|
||||
> Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured
|
||||
> Notification -> Notice Policy -> New Notice Policy -> Enable Notification for the Recipient Just Configured
|
||||
|
||||

|
||||

|
||||
|
||||
7. OK When the threshold is triggered, we can receive the corresponding alarm message. If there is no notification, you can also view the alarm information in the alarm center.
|
||||
|
||||
----
|
||||
|
||||
#### Finish
|
||||
## The End
|
||||
|
||||
The practice of monitoring SSL certificates is here. Of course, for hertzbeat, this function is just the tip of the iceberg. If you think hertzbeat is a good open source project, please give us a Gitee star on GitHub, thank you very much. Thank you for your support. Refill!
|
||||
|
||||
|
||||