blob: 9e27e32934d07ce7d25868a4608bb9356950b55b [file] [log] [blame]
<!doctype html>
<html lang="zh-cn" dir="ltr" class="blog-wrapper blog-post-page plugin-blog plugin-id-default">
<head>
<meta charset="UTF-8">
<meta name="generator" content="Docusaurus v2.3.1">
<title data-rh="true">SSL证书过期监控最佳实践 | HertzBeat</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://hertzbeat.apache.org/zh-cn/img/hertzbeat-logo.svg"><meta data-rh="true" name="twitter:image" content="https://hertzbeat.apache.org/zh-cn/img/hertzbeat-logo.svg"><meta data-rh="true" property="og:url" content="https://hertzbeat.apache.org/zh-cn/blog/2022/09/10/ssl-practice"><meta data-rh="true" name="docusaurus_locale" content="zh-cn"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="zh-cn"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" name="keywords" content="monitor, apm, 监控, 开源, uptime, opensource"><meta data-rh="true" property="og:title" content="SSL证书过期监控最佳实践 | HertzBeat"><meta data-rh="true" name="description" content="先祝看到的同学中秋快乐,身体健康,在身体健康的基础上尽量暴富。"><meta data-rh="true" property="og:description" content="先祝看到的同学中秋快乐,身体健康,在身体健康的基础上尽量暴富。"><meta data-rh="true" property="og:type" content="article"><meta data-rh="true" property="article:published_time" content="2022-09-10T00:00:00.000Z"><meta data-rh="true" property="article:author" content="https://github.com/tomsun28"><meta data-rh="true" property="article:tag" content="opensource,practice"><link data-rh="true" rel="icon" href="/zh-cn/img/hertzbeat-logo.svg"><link data-rh="true" rel="canonical" href="https://hertzbeat.apache.org/zh-cn/blog/2022/09/10/ssl-practice"><link data-rh="true" rel="alternate" href="https://hertzbeat.apache.org/zh-cn/blog/2022/09/10/ssl-practice" hreflang="zh-cn"><link data-rh="true" rel="alternate" href="https://hertzbeat.apache.org/blog/2022/09/10/ssl-practice" hreflang="en"><link data-rh="true" rel="alternate" href="https://hertzbeat.apache.org/blog/2022/09/10/ssl-practice" hreflang="x-default"><link data-rh="true" rel="preconnect" href="https://JMM99UL1H5-dsn.algolia.net" crossorigin="anonymous"><link rel="alternate" type="application/rss+xml" href="/zh-cn/blog/rss.xml" title="HertzBeat RSS Feed">
<link rel="alternate" type="application/atom+xml" href="/zh-cn/blog/atom.xml" title="HertzBeat Atom Feed">
<link rel="alternate" type="application/json" href="/zh-cn/blog/feed.json" title="HertzBeat JSON Feed">
<link rel="search" type="application/opensearchdescription+xml" title="HertzBeat" href="/zh-cn/opensearch.xml">
<link rel="icon" href="/zh-cn/img/hertzbeat-logo.svg">
<link rel="manifest" href="/zh-cn/manifest.json">
<meta name="theme-color" content="rgb(234, 90, 7)">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#000">
<link rel="apple-touch-icon" href="/zh-cn/img/hertzbeat-logo.svg">
<link rel="mask-icon" href="/zh-cn/img/hertzbeat-logo.svg" color="rgb(234, 90, 7)">
<meta name="msapplication-TileImage" content="/zh-cn/img/hertzbeat-logo.svg">
<meta name="msapplication-TileColor" content="#000">
<script src="https://hm.baidu.com/hm.js?77fb03ed1c6c1267119fec6d84dd88f3" async></script><link rel="stylesheet" href="/zh-cn/assets/css/styles.d9b7538f.css">
<link rel="preload" href="/zh-cn/assets/js/runtime~main.d9d3ce85.js" as="script">
<link rel="preload" href="/zh-cn/assets/js/main.53e387bc.js" as="script">
</head>
<body class="navigation-with-keyboard">
<script>!function(){function e(e){document.documentElement.setAttribute("data-theme",e)}var t=function(){var e=null;try{e=localStorage.getItem("theme")}catch(e){}return e}();null!==t?e(t):window.matchMedia("(prefers-color-scheme: dark)").matches?e("dark"):(window.matchMedia("(prefers-color-scheme: light)").matches,e("light"))}()</script><div id="__docusaurus">
<div role="region" aria-label="跳到主要内容"><a class="skipToContent_fXgn" href="#docusaurus_skipToContent_fallback">跳到主要内容</a></div><nav aria-label="主导航" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="切换导航栏" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/zh-cn/"><div class="navbar__logo"><img src="/zh-cn/img/hertzbeat-brand.svg" alt="An open source, real-time monitoring tool with custom-monitor and agentLess." class="themedImage_ToTc themedImage--light_HNdA"><img src="/zh-cn/img/hertzbeat-brand.svg" alt="An open source, real-time monitoring tool with custom-monitor and agentLess." class="themedImage_ToTc themedImage--dark_i4oU"></div><b class="navbar__title text--truncate">HertzBeat</b></a><a class="navbar__item navbar__link" href="/zh-cn/docs/">文档中心</a><a aria-current="page" class="navbar__item navbar__link navbar__link--active" href="/zh-cn/blog/">博客</a><div class="navbar__item dropdown dropdown--hoverable"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">其它信息</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/zh-cn/docs/others/contact">讨论交流</a></li><li><a class="dropdown__link" href="/zh-cn/docs/others/developer">开发者们</a></li><li><a class="dropdown__link" href="/zh-cn/docs/others/contributing">贡献者指南</a></li><li><a href="https://github.com/orgs/apache/projects/6" target="_blank" rel="noopener noreferrer" class="dropdown__link">项目看板<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a class="dropdown__link" href="/zh-cn/docs/others/sponsor">赞助我们</a></li><li><a class="dropdown__link" href="/zh-cn/docs/others/resource">相关资源</a></li></ul></div></div><div class="navbar__items navbar__items--right"><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a class="navbar__link" aria-haspopup="true" aria-expanded="false" role="button" href="/zh-cn/docs/">v1.5.x</a><ul class="dropdown__menu"><li><a class="dropdown__link" href="/zh-cn/docs/">v1.5.x</a></li><li><a class="dropdown__link" href="/zh-cn/docs/v1.4.x/">v1.4.x</a></li><li><a class="dropdown__link" href="/zh-cn/docs/v1.3.x/">v1.3.x</a></li><li><a class="dropdown__link" href="/zh-cn/docs/v1.1.x/">v1.1.x</a></li></ul></div><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link"><svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" class="iconLanguage_nlXk"><path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"></path></svg>中文(中国)</a><ul class="dropdown__menu"><li><a href="/zh-cn/blog/2022/09/10/ssl-practice" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active" lang="zh-cn">中文(中国)</a></li><li><a href="/blog/2022/09/10/ssl-practice" target="_self" rel="noopener noreferrer" class="dropdown__link" lang="en">English</a></li></ul></div><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="切换浅色/暗黑模式(当前为浅色模式)" aria-label="切换浅色/暗黑模式(当前为浅色模式)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="searchBox_ZlJk"><button type="button" class="DocSearch DocSearch-Button" aria-label="搜索"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">搜索</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="container margin-vert--lg"><div class="row"><aside class="col col--3"><nav class="sidebar_re4s thin-scrollbar" aria-label="最近博文导航"><div class="sidebarItemTitle_pO2u margin-bottom--md">近期更新文章</div><ul class="sidebarItemList_Yudw clean-list"><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2024/01/18/hertzbeat-v1.4.4">HertzBeat v1.4.4 发布!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2024/01/11/new-committer">热烈欢迎 HertzBeat 三位小伙伴新晋社区 Committer!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/12/11/hertzbeat-v1.4.3">HertzBeat v1.4.3 发布,Prometheus兼容!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/11/12/hertzbeat-v1.4.2">HertzBeat v1.4.2 版本发布,自定义消息通知模版</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/09/26/hertzbeat-v1.4.1">更好的用户体验, 开源实时监控 HertzBeat v1.4.1 发布</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/08/28/new-committer">热烈欢迎 HertzBeat 小伙伴新晋社区 Committer!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/08/14/hertzbeat-v1.4.0">重磅更新,HertzBeat 集群版发布,易用友好的开源实时监控系统!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/07/05/hertzbeat-v1.3.2">开源实时监控 HertzBeat v1.3.2 发布, 更稳定更易用</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/05/11/greptimedb-store">GreptimeDB &amp; HertzBeat, 使用开源时序数据库 GreptimeDB 存储开源实时监控 HertzBeat 的度量数据</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/05/09/hertzbeat-v1.3.1">50天36位贡献者,开源实时监控工具 HertzBeat v1.3.1 发布</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/03/22/monitor-springboot2">使用 HertzBeat 5分钟搞定 SpringBoot2 监控告警</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/03/15/hertzbeat-v1.3.0">重磅更新 开源实时监控工具 HertzBeat v1.3.0 发布 在线自定义来了</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/02/15/monitor-linux">使用开源实时监控 HertzBeat 监控 Linux 操作系统</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/02/11/monitor-mysql">使用开源实时监控工具 HertzBeat 对 Mysql 数据库监控告警实践</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/02/10/new-committer">恭喜 HertzBeat 又迎来了两位新晋社区 Committer</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/02/02/monitor-dynamic-tp">使用 HertzBeat 对 线程池框架 DynamicTp 的监控实践</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/01/08/monitor-shenyu">使用 HertzBeat 对 API 网关 Apache ShenYu 的监控实践</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2023/01/05/monitor-iotdb">使用 HertzBeat 对物联网数据库 IoTDB 进行监控实践</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/12/28/hertzbeat-v1.2.3">HertzBeat v1.2.3 发布!支持Prometheus,ShenYu,IotDb</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/12/19/new-committer">恭喜 HertzBeat 迎来了两位新晋社区Committer</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/11/28/hertzbeat-v1.2.2">HertzBeat v1.2.2 发布!新增K8S监控等众多特性</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/10/08/hertzbeat-v1.2.0">HertzBeat v1.2.0 发布!易用友好的开源实时监控工具</a></li><li class="sidebarItem__DBe"><a aria-current="page" class="sidebarItemLink_mo7H sidebarItemLinkActive_I1ZP" href="/zh-cn/blog/2022/09/10/ssl-practice">SSL证书过期监控最佳实践</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/09/04/hertzbeat-v1.1.3">云监控系统 HertzBeat v1.1.3 发布!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/07/10/hertzbeat-v1.1.1">云监控系统 HertzBeat v1.1.1 发布!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/06/22/one-step-up">云监控系统 HertzBeat v1.1.0 发布!一条命令即可开启监控之旅!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/06/19/hertzbeat-v1.1.0">云监控系统 HertzBeat v1.1.0 发布!一条命令即可开启监控之旅!</a></li><li class="sidebarItem__DBe"><a class="sidebarItemLink_mo7H" href="/zh-cn/blog/2022/06/01/hertzbeat-v1.0">云监控系统 HertzBeat v1.0 正式发布啦</a></li></ul></nav></aside><main class="col col--7" itemscope="" itemtype="http://schema.org/Blog"><article itemprop="blogPost" itemscope="" itemtype="http://schema.org/BlogPosting"><header><h1 class="title_f1Hy" itemprop="headline">SSL证书过期监控最佳实践</h1><div class="container_mt6G margin-vert--md"><time datetime="2022-09-10T00:00:00.000Z" itemprop="datePublished">2022年9月10日</time> · <!-- -->阅读需 5 分钟</div><div class="margin-top--md margin-bottom--sm row"><div class="col col--6 authorCol_Hf19"><div class="avatar margin-bottom--sm"><a href="https://github.com/tomsun28" target="_blank" rel="noopener noreferrer" class="avatar__photo-link"><img class="avatar__photo" src="https://avatars.githubusercontent.com/u/24788200?s=400&amp;v=4" alt="tom"></a><div class="avatar__intro" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><div class="avatar__name"><a href="https://github.com/tomsun28" target="_blank" rel="noopener noreferrer" itemprop="url"><span itemprop="name">tom</span></a></div><small class="avatar__subtitle" itemprop="description">tom</small></div></div></div></div></header><div id="post-content" class="markdown" itemprop="articleBody"><p>先祝看到的同学中秋快乐,身体健康,在身体健康的基础上尽量暴富。</p><p>进入正题,现在大部分网站都默认支持 HTTPS,我们申请的证书一般是3个月或者1年,很容易随着时间的流逝SSL证书过期了我们却没有第一时间发现,或者在过期之前没有及时更新证书。</p><p>今天这篇文章介绍如果使用 hertzbeat 监控系统来检测我们网站的SSL证书有效期,当证书过期时或证书快过期前几天,给我们发告警消息。</p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="hertzbeat是什么">HertzBeat是什么<a href="#hertzbeat是什么" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接"></a></h4><p>HertzBeat 一个拥有强大自定义监控能力,无需Agent的实时监控工具。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。</p><p><strong>官网: <a href="https://hertzbeat.com" target="_blank" rel="noopener noreferrer">https://hertzbeat.com</a> | <a href="https://tancloud.cn" target="_blank" rel="noopener noreferrer">https://tancloud.cn</a></strong></p><p>github: <a href="https://github.com/dromara/hertzbeat" target="_blank" rel="noopener noreferrer">https://github.com/dromara/hertzbeat</a><br>
<!-- -->gitee: <a href="https://gitee.com/dromara/hertzbeat" target="_blank" rel="noopener noreferrer">https://gitee.com/dromara/hertzbeat</a></p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="安装-hertzbeat">安装 HertzBeat<a href="#安装-hertzbeat" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接"></a></h4><p>1.如果不想安装可以直接使用云服务 <a href="https://console.tancloud.cn" target="_blank" rel="noopener noreferrer">TanCloud探云 console.tancloud.cn</a></p><ol start="2"><li><code>docker</code> 环境仅需一条命令即可安装</li></ol><p><code>docker run -d -p 1157:1157 --name hertzbeat tancloud/hertzbeat</code></p><ol start="3"><li>安装成功浏览器访问 <code>localhost:1157</code> 即可开始,默认账号密码 <code>admin/hertzbeat</code></li></ol><h4 class="anchor anchorWithStickyNavbar_LWe7" id="监控ssl证书">监控SSL证书<a href="#监控ssl证书" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接"></a></h4><ol><li>点击新增SSL证书监控</li></ol><blockquote><p>系统页面 -&gt; 监控菜单 -&gt; SSL证书 -&gt; 新增SSL证书</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="2"><li>配置监控网站</li></ol><blockquote><p>我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。<br>
<!-- -->点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把<strong>是否测试</strong>按钮置灰。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="3"><li>查看检测指标数据</li></ol><blockquote><p>在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="4"><li>设置阈值(证书过期时触发)</li></ol><blockquote><p>系统页面 -&gt; 告警 -&gt; 告警阈值 -&gt; 新增阈值</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><blockquote><p>配置阈值,选择SSL证书指标对象,配置告警表达式-当指标<code>expired</code><code>true</code>触发,即<code>equals(expired,&quot;true&quot;)</code> , 设置告警级别通知模版信息等。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><blockquote><p>关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="5"><li>设置阈值(证书过期前一周触发)</li></ol><blockquote><p>同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 <code>end_timestamp</code><code>now()</code>函数为当前时间戳,若配置提前一周触发告警即:<code>end_timestamp &lt;= (now() + 604800000)</code> , 其中 <code>604800000</code> 为7天总时间差毫秒值。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><blockquote><p>最终可以在告警中心看到已触发的告警。</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="6"><li>告警通知(通过钉钉微信飞书等及时通知)</li></ol><blockquote><p>监控系统 -&gt; 告警通知 -&gt; 新增接收人</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><p>钉钉微信飞书等token配置可以参考帮助文档</p><p><a href="https://hertzbeat.com/docs/help/alert_dingtalk" target="_blank" rel="noopener noreferrer">https://hertzbeat.com/docs/help/alert_dingtalk</a><br>
<a href="https://tancloud.cn/docs/help/alert_dingtalk" target="_blank" rel="noopener noreferrer">https://tancloud.cn/docs/help/alert_dingtalk</a></p><blockquote><p>告警通知 -&gt; 新增告警通知策略 -&gt; 将刚才配置的接收人启用通知</p></blockquote><p><img loading="lazy" src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image" class="img_ev3q"></p><ol start="7"><li>OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。</li></ol><hr><h4 class="anchor anchorWithStickyNavbar_LWe7" id="完">完!<a href="#完" class="hash-link" aria-label="标题的直接链接" title="标题的直接链接"></a></h4><p>监控SSL证书的实践就到这里,当然对hertzbeat来说这个功能只是冰山一角,如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯!</p><p><strong>github: <a href="https://github.com/dromara/hertzbeat" target="_blank" rel="noopener noreferrer">https://github.com/dromara/hertzbeat</a></strong></p><p><strong>gitee: <a href="https://gitee.com/dromara/hertzbeat" target="_blank" rel="noopener noreferrer">https://gitee.com/dromara/hertzbeat</a></strong></p></div><footer class="row docusaurus-mt-lg blogPostFooterDetailsFull_mRVl"><div class="col"><b>标签:</b><ul class="tags_jXut padding--none margin-left--sm"><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/zh-cn/blog/tags/opensource">opensource</a></li><li class="tag_QGVx"><a class="tag_zVej tagRegular_sFm0" href="/zh-cn/blog/tags/practice">practice</a></li></ul></div><div class="col margin-top--sm"><a href="https://github.com/apache/hertzbeat/edit/master/home/i18n/zh-cn/docusaurus-plugin-content-blog/2022-09-10-ssl-practice.md" target="_blank" rel="noreferrer noopener" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>编辑此页</a></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="博文分页导航"><a class="pagination-nav__link pagination-nav__link--prev" href="/zh-cn/blog/2022/10/08/hertzbeat-v1.2.0"><div class="pagination-nav__sublabel">较新一篇</div><div class="pagination-nav__label">HertzBeat v1.2.0 发布!易用友好的开源实时监控工具</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/zh-cn/blog/2022/09/04/hertzbeat-v1.1.3"><div class="pagination-nav__sublabel">较旧一篇</div><div class="pagination-nav__label">云监控系统 HertzBeat v1.1.3 发布!</div></a></nav></main><div class="col col--2"><div class="tableOfContents_bqdL thin-scrollbar"></div></div></div></div></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">产品介绍</div><ul class="footer__items clean-list"><li class="footer__item"><a class="footer__link-item" href="/zh-cn/docs/start/quickstart">安装文档</a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn/docs/help/guide">帮助文档</a></li></ul></div><div class="col footer__col"><div class="footer__title">社区交流</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/apache/hertzbeat/discussions/" target="_blank" rel="noopener noreferrer" class="footer__link-item">社区讨论<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn/docs/others/contact">联系交流</a></li></ul></div><div class="col footer__col"><div class="footer__title">相关资源</div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/apache/hertzbeat" target="_blank" rel="noopener noreferrer" class="footer__link-item">Github仓库<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li class="footer__item"><a class="footer__link-item" href="/zh-cn/docs/others/resource">其它资源</a></li></ul></div></div><div class="footer__bottom text--center"><div class="margin-bottom--sm"><a href="https://github.com/apache/hertzbeat" rel="noopener noreferrer" class="footerLogoLink_BH7S"><img src="/zh-cn/img/hertzbeat-brand.svg" alt="HertzBeat" class="themedImage_ToTc themedImage--light_HNdA footer__logo"><img src="/zh-cn/img/hertzbeat-brand.svg" alt="HertzBeat" class="themedImage_ToTc themedImage--dark_i4oU footer__logo"></a></div><div class="footer__copyright">Copyright © 2024 Apache HertzBeat</div></div></div></footer></div>
<script src="/zh-cn/assets/js/runtime~main.d9d3ce85.js"></script>
<script src="/zh-cn/assets/js/main.53e387bc.js"></script>
</body>
</html>