Skip to main content

· 5 min read
tom

先祝看到的同学中秋快乐,身体健康,在身体健康的基础上尽量暴富。

进入正题,现在大部分网站都默认支持 HTTPS,我们申请的证书一般是3个月或者1年,很容易随着时间的流逝SSL证书过期了我们却没有第一时间发现,或者在过期之前没有及时更新证书。

今天这篇文章介绍如果使用 hertzbeat 监控系统来检测我们网站的SSL证书有效期,当证书过期时或证书快过期前几天,给我们发告警消息。

HertzBeat是什么

HertzBeat 一个拥有强大自定义监控能力,无需Agent的实时监控系统。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。

官网: https://hertzbeat.com | https://tancloud.cn

github: https://github.com/dromara/hertzbeat
gitee: https://gitee.com/dromara/hertzbeat

安装 HertzBeat

1.如果不想安装可以直接使用云服务 TanCloud探云 console.tancloud.cn

  1. docker 环境仅需一条命令即可安装

docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat

  1. 安装成功浏览器访问 localhost:1157 即可开始,默认账号密码 admin/hertzbeat

监控SSL证书

  1. 点击新增SSL证书监控

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

  1. 配置监控网站

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

  1. 查看检测指标数据

在监控列表可以查看监控状态,进监控详情可以查看指标数据图表等。

  1. 设置阈值(证书过期时触发)

系统页面 -> 告警 -> 告警阈值 -> 新增阈值

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

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

  1. 设置阈值(证书过期前一周触发)

同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 end_timestampnow()函数为当前时间戳,若配置提前一周触发告警即:end_timestamp <= (now() + 604800000) , 其中 604800000 为7天总时间差毫秒值。

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

  1. 告警通知(通过钉钉微信飞书等及时通知)

监控系统 -> 告警通知 -> 新增接收人

钉钉微信飞书等token配置可以参考帮助文档

https://hertzbeat.com/docs/help/alert_dingtalk
https://tancloud.cn/docs/help/alert_dingtalk

告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知

  1. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。

完!

监控SSL证书的实践就到这里,当然对hertzbeat来说这个功能只是冰山一角,如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯!

github: https://github.com/dromara/hertzbeat

gitee: https://gitee.com/dromara/hertzbeat

· 3 min read
tom

Home: hertzbeat.com | tancloud.cn

Hi gays! HertzBeat v1.1.3 is coming. This version supports kafka monitor, ssl certificate expired monitor and more. Fixed several bugs and improved the overall stable usability.

Only one docker command is needed to install and experience hertzbeat: docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat

Thanks to the contributors! 👍👍

Feature:

  1. [web-app]feature:update monitors layout, support host copy to clipboard #260
  2. [monitor] feature: support apache kafka monitor #263 contribute by @wang1027-wqh
  3. [webapp] support history chart query 3 mouth time range #265 issue by @ericfrol
  4. [monitor] support ssl certificate expired monitor #266 suggest by @noear
  5. [web-app] update default interval 600s to 120s #268
  6. [web-app] update layout ui - help button, nav menu #272
  7. [alert,webapp] support delete all alerts at once. #273 issue by @ericfrol
  8. [web-app] update home background image #276

Bugfix.

  1. [docs] fix extend-http-jsonpath.md parseScript error #262 contribute by @woshiniusange .
  2. [monitor] update help docs, refactor redis metrics name #264
  3. [manager] bugfix alert tags is null when tags map key normal value null. #270 issue by https://gitee.com/hello_brother_niu
  4. [alert] bugfix: the alert global preset config do not take effect #275 issue by https://gitee.com/hello_brother_niu

Online https://console.tancloud.cn.

Have Fun!


V1.1.3

官网: hertzbeat.com | tancloud.cn

大家好,HertzBeat v1.1.3 发布啦!这个版本支持了apache kafka监控,SSL证书过期监控等。修复了若干bug,提升整体稳定性。

只需要一条docker命令即可安装体验hertzbeat : docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat

感谢hertzbeat贡献者们的贡献!👍👍

Feature:

  1. [web-app]feature:update monitors layout, support host copy to clipboard #260
  2. [monitor] feature: support apache kafka monitor #263 contribute by @wang1027-wqh
  3. [webapp] support history chart query 3 mouth time range #265 issue by @ericfrol
  4. [monitor] support ssl certificate expired monitor #266 suggest by @noear
  5. [web-app] update default interval 600s to 120s #268
  6. [web-app] update layout ui - help button, nav menu #272
  7. [alert,webapp] support delete all alerts at once. #273 issue by @ericfrol
  8. [web-app] update home background image #276

Bugfix.

  1. [docs] fix extend-http-jsonpath.md parseScript error #262 contribute by @woshiniusange .
  2. [monitor] update help docs, refactor redis metrics name #264
  3. [manager] bugfix alert tags is null when tags map key normal value null. #270 issue by https://gitee.com/hello_brother_niu
  4. [alert] bugfix: the alert global preset config do not take effect #275 issue by https://gitee.com/hello_brother_niu

Online https://console.tancloud.cn.

Have Fun!

· 3 min read
tom

Friendly Cloud Monitoring System. | 易用友好的实时监控系统, 无需Agent, 强大自定义监控能力.

Home: hertzbeat.com

Hi gays! HertzBeat v1.1.1 is coming. This version brings custom monitoring enhancements, and the collected indicator data can be assigned as a variable to the next collection. Fixed several bugs and improved the overall stable usability.

Only one docker command is needed to install and experience hertzbeat: docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat

Thanks to the contributors! 👍👍

Feature:

  1. [script] feature update docker base image to openjdk:11.0.15-jre-slim… #205
  2. [monitor] support use pre collect metrics data to replace next metrics config params #206.
  3. [collector] use basic auth with raw HTTP headers instead of preemptive #212
  4. [manager,alerter] support wework, dingDing, flyBook webhook url config #213
  5. [monitor] feature update numeric metrics all contain decimal points #217
  6. [web-app]feature:toggle [enable and cancel] button #218
  7. [manager] update define yml file name add prefix "app" or "param" #221

Bugfix.

  1. [update] docker-compose 添加jpa自动执行脚本,删除sql脚本 #198 contribute by @DevilX5 .
  2. Doc#param names refactor #199 contribute by @DevilX5
  3. [manager] bugfix oracle performance metrics collect error, update win name #201.
  4. [common] bugfix alert status can not update #203
  5. [manager] bugfix update windows monitor type name #204
  6. fix time zone todo issue #210 contribute by @djzeng
  7. [common] bugfix SnowFlakeId cannot exceed hexadecimal 0x1FFFFFFFFFFFFFF #211
  8. [manager] 修改监控页面取消监控功能再启动监控导致多生成jobId,原有监控项目并没有真实取消 #215 contribute by @yangshihui
  9. [warehouse] bugfix exception when tdengine create table SQL contain special char #220

Online https://console.tancloud.cn.

Have Fun!


HertzBeat is an opensource monitoring and alarm project incubated by Dromara and open sourced by TanCloud, which supports Website, API, PING, Port, Database, OS Monitor etc.
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 and WebHook.
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 HertzBeat's Cloud Environment TanCloud to try and discover more.
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.

If you like HertzBeat, give us a star on GitHub

Github https://github.com/dromara/hertzbeat
Gitee https://gitee.com/dromara/hertzbeat