Sign inSign up

dromara/hertzbeat

By dromara

•Updated over 3 years ago

An open-source, real-time monitoring tool with custom-monitor and agentless.

Image
0

432

dromara/hertzbeat repository overview

⁠HertzBeat

An open-source, real-time monitoring system with custom-monitor and agentless. | 易用友好的实时监控系统,无需Agent,强大自定义监控能力.

Gitter tan-cloud tan-cloud tan-cloud tan-cloud tan-cloud tan-cloud tan-cloud tan-cloud tan-cloud

Home: hertzbeat.com⁠ | tancloud.cn⁠.
GitHub: https://github.com/dromara/hertzbeat⁠

⁠🎡 Introduction

HertzBeat⁠ is an open-source, real-time monitoring system with custom-monitor and agentless. Support web service, database, os, middleware and more.
We also provide Monitoring Cloud For Saas⁠, people no longer need to deploy a cumbersome monitoring system in order to monitor their website resources. Sign in to get started for free⁠.
HertzBeat supports more liberal threshold alarm configuration (calculation expression), supports alarm notification, alarm template, email, dingDing, weChat, feiShu, webhook and more.
Most important is HertzBeat supports Custom Monitoring⁠, just by configuring the YML file, we can customize the monitoring types and metrics what we need.
HertzBeat is modular, manager, collector, scheduler, warehouse, alerter modules are decoupled for easy understanding and custom development.
Welcome to join us to build hertzbeat together.

HertzBeat's multi-type support, easy expansion, low coupling, hope to help developers and micro teams to quickly build their own monitoring system.


⁠🐕 Quick Start
⁠🍞 Install HertzBeat

HertzBeat supports installation through source code, docker or package, cpu support X86/ARM64.

⁠Install quickly via docker
  1. Just one command to get started: docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat

  2. Access localhost:1157 to start, default account: admin/hertzbeat

⁠More HertzBeat Config
$ docker run -d -p 1157:1157 \
    -e LANG=zh_CN.UTF-8 \
    -e TZ=Asia/Shanghai \
    -v /opt/data:/opt/hertzbeat/data \
    -v /opt/logs:/opt/hertzbeat/logs \
    -v /opt/application.yml:/opt/hertzbeat/config/application.yml \
    -v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml \
    --name hertzbeat tancloud/hertzbeat

This command starts a running HertzBeat Docker container, and the container port 1157 is mapped to the host machine 1157. If existing processes on the host use the port, please modify host mapped port.

  • docker run -d : Run a container in the background via Docker
  • -p 1157:1157 : Mapping container ports to the host
  • -e LANG=zh_CN.UTF-8 : (optional) set the LANG
  • -e TZ=Asia/Shanghai : (optional) set the TimeZone
  • -v /opt/data:/opt/hertzbeat/data : (optional,data persistence) Important⚠️ Mount the H2 database file to the local host, to ensure that the data is not lost because of creating or deleting container.
  • -v /opt/logs:/opt/hertzbeat/logs : (optional) Mount the log file to the local host, to guarantee the log will not be lost because of creating or deleting container.
  • -v /opt/application.yml:/opt/hertzbeat/config/application.yml : (optional) Mount the local configuration file into the container which has been modified in the previous step, namely using the local configuration file to cover container configuration file. We need to modify MYSQL, TDengine configuration information in the configuration file to connect to an external service.
  • -v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml : (optional) Mount account configuration file modified in the previous step into the container. Delete this command parameters if have no modify account needs.
  • --name hertzbeat : Naming container name hertzbeat
  • tancloud/hertzbeat : Use the latest HertzBeat mirror tag to start the container. version can be looked up in official mirror repository⁠

1.. Configure HertzBeat's configuration file(optional)
Create application.yml in the host directory,eg:/opt/application.yml
The configuration file content refer to project repository/script/application.yml⁠,modify service parameters, IP port account password in td-engine or iotdb
Note⚠️(If use email to alert, please replace the mail server parameter. If use MYSQL data source, replace the datasource parameters inside refer toH2 database switch to MYSQL⁠)
Specific replacement parameters is as follows:

   
warehouse:
  store:
# store history metrics data, enable only one below
# 存储历史数据方式, 下方只能enabled启用一种方式
    jpa:
      enabled: true
      expire-time: 7D
    td-engine:
      enabled: false
      driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
      url: jdbc:TAOS-RS://localhost:6041/hertzbeat
      username: root
      password: taosdata
    iot-db:
      enabled: false
      host: 127.0.0.1
      rpc-port: 6667
      username: root
      password: root
      # org.apache.iotdb.session.util.Version: V_O_12 || V_0_13
      version: V_0_13
      # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0
      query-timeout-in-ms: -1
      # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期)
      # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire)
      expire-time: '7776000000'
# store real-time metrics data, enable only one below
# 存储实时数据方式, 下方只能enabled启用一种方式
    memory:
      enabled: true
      init-size: 1024
    redis:
      enabled: false
      host: 127.0.0.1
      port: 6379
      password: 123456
         
spring:
   mail:
      # Attention: this is mail server address.
      host: smtp.exmail.qq.com
      username: [email protected]
      # Attention: this is not email account password, this requires an email authorization code
      password: example
      port: 465
  1. Configure the user configuration file(optional, custom user password)
    HertzBeat default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat If you need add, delete or modify account or password, configure sureness.yml. Ignore this step without this demand.
    Create sureness.yml in the host directory,eg:/opt/sureness.yml
    The configuration file content refer to project repository/script/sureness.yml⁠

resourceRole:
   - /api/account/auth/refresh===post===[admin,user,guest]
   - /api/apps/**===get===[admin,user,guest]
   - /api/monitor/**===get===[admin,user,guest]
   - /api/monitor/**===post===[admin,user]
   - /api/monitor/**===put===[admin,user]
   - /api/monitor/**===delete==[admin]
   - /api/monitors/**===get===[admin,user,guest]
   - /api/monitors/**===post===[admin,user]
   - /api/monitors/**===put===[admin,user]
   - /api/monitors/**===delete===[admin]
   - /api/alert/**===get===[admin,user,guest]
   - /api/alert/**===post===[admin,user]
   - /api/alert/**===put===[admin,user]
   - /api/alert/**===delete===[admin]
   - /api/alerts/**===get===[admin,user,guest]
   - /api/alerts/**===post===[admin,user]
   - /api/alerts/**===put===[admin,user]
   - /api/alerts/**===delete===[admin]
   - /api/notice/**===get===[admin,user,guest]
   - /api/notice/**===post===[admin,user]
   - /api/notice/**===put===[admin,user]
   - /api/notice/**===delete===[admin]
   - /api/tag/**===get===[admin,user,guest]
   - /api/tag/**===post===[admin,user]
   - /api/tag/**===put===[admin,user]
   - /api/tag/**===delete===[admin]
   - /api/summary/**===get===[admin,user,guest]
   - /api/summary/**===post===[admin,user]
   - /api/summary/**===put===[admin,user]
   - /api/summary/**===delete===[admin]

# Resources that need to be filtered and protected can be accessed directly without authentication
# /api/v1/source3===get means /api/v1/source3===get it can be accessed by anyone. Don't need to authentication
excludedResource:
   - /api/account/auth/**===*
   - /api/i18n/**===get
   - /api/apps/hierarchy===get
   # web ui 
   - /===get
   - /dashboard/**===get
   - /monitors/**===get
   - /alert/**===get
   - /account/**===get
   - /setting/**===get
   - /passport/**===get
   - /**/*.html===get
   - /**/*.js===get
   - /**/*.css===get
   - /**/*.ico===get
   - /**/*.ttf===get
   - /**/*.png===get
   - /**/*.gif===get
   - /**/*.jpg===get
   - /**/*.svg===get
   - /**/*.json===get
   # swagger ui 
   - /swagger-resources/**===get
   - /v2/api-docs===get
   - /v3/api-docs===get
   # h2 database
   - /h2-console/**===*

# user account information
# Here is admin tom lili three accounts
# eg: admin includes[admin,user]roles, password is hertzbeat 
# eg: tom includes[user], password is hertzbeat
# eg: lili includes[guest],text password is lili, salt password is 1A676730B0C7F54654B0E09184448289
account:
   - appId: admin
     credential: hertzbeat
     role: [admin,user]
   - appId: tom
     credential: hertzbeat
     role: [user]
   - appId: guest
     credential: hertzbeat
     role: [guest]

Modify the following part parameters in sureness.yml [Note⚠️Other default sureness configuration parameters should be retained] :


# user account information
# Here is admin tom lili three accounts
# eg: admin includes[admin,user]roles, password is hertzbeat 
# eg: tom includes[user], password is hertzbeat
# eg: lili includes[guest], text password is lili, salt password is 1A676730B0C7F54654B0E09184448289
account:
   - appId: admin
     credential: hertzbeat
     role: [admin,user]
   - appId: tom
     credential: hertzbeat
     role: [user]
   - appId: guest
     credential: hertzbeat
     role: [guest]

HAVE FUN

Tag summary

Content type

Image

Digest

sha256:e93fe1290…

Size

179.2 MB

Last updated

over 3 years ago

docker pull dromara/hertzbeat