| <div role="region"><a href="#" class="skipToContent_fXgn">跳到主要内容</a></div><nav class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Navigation bar toggle" class="navbar__toggle clean-btn" type="button" tabindex="0"><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/dromara/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/2023/02/11/monitor-mysql" target="_self" rel="noopener noreferrer" class="dropdown__link dropdown__link--active">中文(中国)</a></li><li><a href="/blog/2023/02/11/monitor-mysql" target="_self" rel="noopener noreferrer" class="dropdown__link">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="切换浅色/暗黑模式(当前为浅色模式)"><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 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 & 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 aria-current="page" class="sidebarItemLink_mo7H sidebarItemLinkActive_I1ZP" 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 class="sidebarItemLink_mo7H" 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">使用开源实时监控工具 HertzBeat 对 Mysql 数据库监控告警实践</h1><div class="container_mt6G margin-vert--md"><time datetime="2023-02-11T00:00:00.000Z" itemprop="datePublished">2023年2月11日</time> · <!-- -->阅读需 8 分钟</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&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"><h2 class="anchor anchorWithStickyNavbar_LWe7" id="使用开源实时监控工具-hertzbeat-对-mysql-数据库监控告警实践5分钟搞定">使用开源实时监控工具 HertzBeat 对 Mysql 数据库监控告警实践,5分钟搞定!<a class="hash-link" href="#使用开源实时监控工具-hertzbeat-对-mysql-数据库监控告警实践5分钟搞定" title="标题的直接链接"></a></h2><h3 class="anchor anchorWithStickyNavbar_LWe7" id="mysql-数据库介绍">Mysql 数据库介绍<a class="hash-link" href="#mysql-数据库介绍" title="标题的直接链接"></a></h3><blockquote><p>MySQL是一个开源关系型数据库管理系统,由瑞典MySQL AB 公司开发,属于 Oracle 旗下产品。MySQL 是最流行的开源关系型数据库管理系统之一,在 WEB 应用方面,MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。</p></blockquote><h3 class="anchor anchorWithStickyNavbar_LWe7" id="hertzbeat-介绍">HertzBeat 介绍<a class="hash-link" href="#hertzbeat-介绍" title="标题的直接链接"></a></h3><blockquote><p>HertzBeat 是一款开源,易用友好的实时监控工具,无需Agent,拥有强大自定义监控能力。 </p></blockquote><ul><li>集<strong>监控-告警-通知为一体</strong>,支持对应用服务,数据库,操作系统,中间件,云原生等监控,阈值告警,告警通知(邮件微信钉钉飞书短信 Slack Discord Telegram)。 </li><li>其将Http, Jmx, Ssh, Snmp, Jdbc, Prometheus等协议规范可配置化,只需配置YML就能使用这些协议去自定义采集任何您想要采集的指标。您相信只需配置YML就能立刻适配一个K8s或Docker等新的监控类型吗? </li><li>HertzBeat 的强大自定义,多类型支持,易扩展,低耦合,希望能帮助开发者和中小团队快速搭建自有监控系统。 </li></ul><h3 class="anchor anchorWithStickyNavbar_LWe7" id="在-hertzbeat-5分钟搞定对-mysql-数据库监控">在 HertzBeat 5分钟搞定对 Mysql 数据库监控<a class="hash-link" href="#在-hertzbeat-5分钟搞定对-mysql-数据库监控" title="标题的直接链接"></a></h3><h4 class="anchor anchorWithStickyNavbar_LWe7" id="操作前提您已拥有-mysql-环境和-hertzbeat-环境">操作前提,您已拥有 Mysql 环境和 HertzBeat 环境。<a class="hash-link" href="#操作前提您已拥有-mysql-环境和-hertzbeat-环境" title="标题的直接链接"></a></h4><ul><li>Mysql <a href="https://www.runoob.com/mysql/mysql-install.html" target="_blank" rel="noopener noreferrer">安装部署文档</a> </li><li>HertzBeat <a href="https://hertzbeat.com/docs/start/docker-deploy" target="_blank" rel="noopener noreferrer">安装部署文档</a></li></ul><h4 class="anchor anchorWithStickyNavbar_LWe7" id="在开源监控系统-hertzbeat-监控页面添加对-mysql-数据库监控">在开源监控系统 HertzBeat 监控页面添加对 Mysql 数据库监控<a class="hash-link" href="#在开源监控系统-hertzbeat-监控页面添加对-mysql-数据库监控" title="标题的直接链接"></a></h4><ol><li>点击新增 Mysql 监控 </li></ol><p>路径:菜单 -> 数据库监控 -> Mysql数据库 -> 新增Mysql数据库监控 </p><p><img loading="lazy" alt="hertzbeat" src="/zh-cn/assets/images/monitor-mysql-1-19e6ec4459f0d9e919f6a6c30be7b57a.png" width="4064" height="2166" class="img_ev3q"></p><ol start="2"><li>配置新增监控 Mysql 数据库所需参数 </li></ol><p>在监控页面填写 Mysql <strong>服务IP</strong>,<strong>监控端口</strong>(默认3306),<strong>账户密码等</strong>,最后点击确定添加即可。<br> |
| <!-- -->当然只是看肯定是不完美的,监控往往伴随着告警阈值,当 Mysql 数据库的指标超出我们的期望值或异常时,能及时的通知到我们对应的负责人,负责人收到通知处理问题,这样才是一个完整的监控告警流程。</p></div></div><p><strong>接下来我们就来一步一步演示如何配置 HertzBeat 系统里的阈值告警通知,让及时发现 Mysql 数据库的指标异常时,及时通知给我们</strong> </p><h4 class="anchor anchorWithStickyNavbar_LWe7" id="三-在-hertzbeat-系统添加-mysql-数据库指标阈值告警">三. 在 HertzBeat 系统添加 Mysql 数据库指标阈值告警<a class="hash-link" href="#三-在-hertzbeat-系统添加-mysql-数据库指标阈值告警" title="标题的直接链接"></a></h4><ol><li>对某个重要指标配置告警阈值 </li></ol><p>路径:菜单 -> 阈值规则 -> 新增阈值 </p><ul><li>选择配置的指标对象,Mysql 数据库监控主要是数据库性能等相关指标,我们举例对 <code>查询缓存命中率</code> <code>cache</code> -> <code>query_cache_hit_rate</code> 这个指标进行阈值设置, 当Mysql的查询缓存命中率很低小于30%时发出告警。 </li><li>这里我们就配置当此指标<code>cache</code> 的 <code>query_cache_hit_rate<30</code> 时发出告警,告警级别为<strong>严重告警</strong>,三次即触发,具体如下图。 </li></ul><p><img loading="lazy" alt="hertzbeat" src="/zh-cn/assets/images/monitor-mysql-5-de9e52572120721588e3ec4207999d97.png" width="4064" height="2166" class="img_ev3q"> </p><p><img loading="lazy" alt="hertzbeat" src="/zh-cn/assets/images/monitor-mysql-6-734d367e3a2cd939c75d3ea9204bd615.png" width="4064" height="2166" class="img_ev3q"></p><ol start="2"><li>新增消息通知接收人</li></ol><blockquote><p>配置接收人,让告警消息知道要发给谁,用什么方式发。 </p></blockquote><p>路径:菜单 -> 告警通知 -> 告警接收人 -> 新增接收人 </p><p>消息通知方式支持 <strong>邮件,钉钉,企业微信,飞书,WebHook,短信</strong>等,我们这里以常用的钉钉为例。 </p><ul><li>参照此<a href="https://hertzbeat.com/docs/help/alert_dingtalk" target="_blank" rel="noopener noreferrer">帮助文档</a> <a href="https://hertzbeat.com/docs/help/alert_dingtalk" target="_blank" rel="noopener noreferrer">https://hertzbeat.com/docs/help/alert_dingtalk</a> 在钉钉端配置机器人,设置安全自定义关键词<code>HertzBeat</code>,获取对应<code>access_token</code>值。 </li><li>在 HertzBeat 配置接收人参数如下。 </li></ul><p>【告警通知】->【新增接收人】 ->【选择钉钉机器人通知方式】->【设置钉钉机器人ACCESS_TOKEN】-> 【确定】</p><p><img loading="lazy" alt="hertzbeat" src="/zh-cn/assets/images/alert-notice-1-3bad6e06e2c870849bc656a2092d59ac.png" width="3436" height="890" class="img_ev3q"> </p><ol start="3"><li>配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】 </li></ol><blockquote><p>配置告警通知策略,让告警消息与接收人绑定,这样就能决定哪些告警发给哪个人。</p></blockquote><p><img loading="lazy" alt="hertzbeat" src="/zh-cn/assets/images/alert-notice-2-8025b90624873463fe0a3f75bd7efafa.png" width="3436" height="1088" class="img_ev3q"> </p><h3 class="anchor anchorWithStickyNavbar_LWe7" id="完毕现在坐等告警消息过来啦叮叮叮叮">完毕,现在坐等告警消息过来啦。叮叮叮叮<a class="hash-link" href="#完毕现在坐等告警消息过来啦叮叮叮叮" title="标题的直接链接"></a></h3><div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#393A34"><span class="token plain">[HertzBeat告警通知]</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">告警目标对象 : mysql.cahce.query_cache_hit_rate</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">所属监控任务ID : 205540620394932</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">所属任务名称 : Mysql_localhost</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">告警级别 : 严重告警</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">告警触发时间 : 2023-02-11 21:13:44</span><br></span><span class="token-line" style="color:#393A34"><span class="token plain">内容详情 : mysql db query_cache_hit_rate is too low, now is 20.</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="复制代码到剪贴板" title="复制" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg class="copyButtonIcon_y97N" viewBox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div><h2 class="anchor anchorWithStickyNavbar_LWe7" id="小结">小结<a class="hash-link" href="#小结" title="标题的直接链接"></a></h2><div class="theme-admonition theme-admonition-tip alert alert--success admonition_LlT9"><div class="admonitionHeading_tbUL"><span class="admonitionIcon_kALy"><svg viewBox="0 0 12 16"><path fill-rule="evenodd" d="M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"></path></svg></span>提示</div><div class="admonitionContent_S0QG"><p>这篇实践文章带我们体验了如何使用开源实时监控工具 HertzBeat 来监控 Mysql 数据库指标数据,可以发现集 <code>监控-告警-通知</code> 的 HertzBeat 在操作与使用方面更加的便捷,只需页面上简单点一点就能把 Mysql 数据库纳入监控并告警通知,再也不需要部署多个组件编写配置文件那些繁琐操作了。 </p></div></div><p>Mysql Github: <a href="https://github.com/mysql/mysql-server" target="_blank" rel="noopener noreferrer">https://github.com/mysql/mysql-server</a><br> |