Prometheus监控MongoDB报警规则、MySQL报警规则、Nginx报警规则、Redis报警规则。

MongoDB报警规则

报警名称 表达式 采集数据时间(分钟) 报警触发条件
MongodbReplicationLag avg(mongodb_replset_member_optime_date{state=“PRIMARY”}) - avg(mongodb_replset_member_optime_date{state=“SECONDARY”}) > 10 5 复制延迟过长。
MongodbReplicationHeadroom (avg(mongodb_replset_oplog_tail_timestamp - mongodb_replset_oplog_head_timestamp) - (avg(mongodb_replset_member_optime_date{state=“PRIMARY”}) - avg(mongodb_replset_member_optime_date{state=“SECONDARY”}))) <= 0 5 复制余量不足。
MongodbReplicationStatus3 mongodb_replset_member_state == 3 5 复制状态为3。
MongodbReplicationStatus6 mongodb_replset_member_state == 6 5 复制状态为6。
MongodbReplicationStatus8 mongodb_replset_member_state == 8 5 复制状态为8。
MongodbReplicationStatus10 mongodb_replset_member_state == 10 5 复制状态为10。
MongodbNumberCursorsOpen mongodb_metrics_cursor_open{state=“total_open”} > 10000 5 打开数字光标数量过多。
MongodbCursorsTimeouts sum (increase increase(mongodb_metrics_cursor_timed_out_total[10m]) > 100 5 若光标超。
MongodbTooManyConnections mongodb_connections{state=“current”} > 500 5 连接过多。
MongodbVirtualMemoryUsage (sum(mongodb_memory{type=“virtual”}) BY (ip) / sum(mongodb_memory{type=“mapped”}) BY (ip)) > 3 5 虚拟内存使用率过高。

MySQL报警规则

报警名称 表达式 采集数据时间(分钟) 报警触发条件
MySQL is down mysql_up == 0 1 MySQL下线。
open files high mysql_global_status_innodb_num_open_files > (mysql_global_variables_open_files_limit) * 0.75 1 打开文件数量偏高。
Read buffer size is bigger than max. allowed packet size mysql_global_variables_read_buffer_size > mysql_global_variables_slave_max_allowed_packet 1 读取缓存区超过数据包最大限制。
Sort buffer possibly missconfigured mysql_global_variables_innodb_sort_buffer_size <2561024 or mysql_global_variables_read_buffer_size > 41024*1024 1 排序缓冲区可能存在配置错误。
Thread stack size is too small mysql_global_variables_thread_stack <196608 1 线程堆栈太小。
Used more than 80% of max connections limited mysql_global_status_max_used_connections > mysql_global_variables_max_connections * 0.8 1 使用超过80%连接限制。
InnoDB Force Recovery is enabled mysql_global_variables_innodb_force_recovery != 0 1 启用强制恢复。
InnoDB Log File size is too small mysql_global_variables_innodb_log_file_size < 16777216 1 日志文件过小。
InnoDB Flush Log at Transaction Commit mysql_global_variables_innodb_flush_log_at_trx_commit != 1 1 在事务提交时刷新日志。
Table definition cache too small mysql_global_status_open_table_definitions > mysql_global_variables_table_definition_cache 1 表定义缓存过小。
Table open cache too small mysql_global_status_open_tables >mysql_global_variables_table_open_cache * 99/100 1 表打开缓存过小。
Thread stack size is possibly too small mysql_global_variables_thread_stack < 262144 1 线程堆栈可能过小。
InnoDB Buffer Pool Instances is too small mysql_global_variables_innodb_buffer_pool_instances == 1 1 缓冲池实例过小。
InnoDB Plugin is enabled mysql_global_variables_ignore_builtin_innodb == 1 1 插件启用。
Binary Log is disabled mysql_global_variables_log_bin != 1 1 二进制日志禁用。
Binlog Cache size too small mysql_global_variables_binlog_cache_size < 1048576 1 缓存过小。
Binlog Statement Cache size too small mysql_global_variables_binlog_stmt_cache_size <1048576 and mysql_global_variables_binlog_stmt_cache_size > 0 1 声明缓存过小。
Binlog Transaction Cache size too small mysql_global_variables_binlog_cache_size <1048576 1 交易缓存过小。
Sync Binlog is enabled mysql_global_variables_sync_binlog == 1 1 二进制日志启用。
IO thread stopped mysql_slave_status_slave_io_running != 1 1 IO线程停止。
SQL thread stopped mysql_slave_status_slave_sql_running == 0 1 SQL线程停止。
Mysql_Too_Many_Connections rate(mysql_global_status_threads_connected[5m])>200 5 连接过多。
Mysql_Too_Many_slow_queries rate(mysql_global_status_slow_queries[5m])>3 5 慢查询过多。
Slave lagging behind Master rate(mysql_slave_status_seconds_behind_master[1m]) >30 1 从机表现落后于主机。
Slave is NOT read only(Please ignore this warning indicator.) mysql_global_variables_read_only != 0 1 从机权限不是只读。

Nginx报警规则

报警名称 表达式 采集数据时间(分钟) 报警触发条件
NginxHighHttp4xxErrorRate sum(rate(nginx_http_requests_total{status=~"^4…"}[1m])) / sum(rate(nginx_http_requests_total[1m])) * 100 > 5 5 HTTP 4xx错误率过高。
NginxHighHttp5xxErrorRate sum(rate(nginx_http_requests_total{status=~"^5…"}[1m])) / sum(rate(nginx_http_requests_total[1m])) * 100 > 5 5 HTTP 5xx错误率过高。
NginxLatencyHigh histogram_quantile(0.99, sum(rate(nginx_http_request_duration_seconds_bucket[30m])) by (host, node)) > 10 5 延迟过高。

Redis报警规则

报警名称 表达式 采集数据时间(分钟) 报警触发条件
RedisDown redis_up == 0 5 Redis下线。
RedisMissingMaster count(redis_instance_info{role=“master”}) == 0 5 Master缺失。
RedisTooManyMasters count(redis_instance_info{role=“master”}) > 1 5 Master过多。
RedisDisconnectedSlaves count without (instance, job) (redis_connected_slaves) - sum without (instance, job) (redis_connected_slaves) - 1 > 1 5 Slave连接断开。
RedisReplicationBroken delta(redis_connected_slaves[1m]) < 0 5 复制中断。
RedisClusterFlapping changes(redis_connected_slaves[5m]) > 2 5 副本连接识别变更。
RedisMissingBackup time() - redis_rdb_last_save_timestamp_seconds > 60 * 60 * 24 5 备份中断。
RedisOutOfMemory redis_memory_used_bytes / redis_total_system_memory_bytes * 100 > 90 5 内存不足。
RedisTooManyConnections redis_connected_clients > 100 5 连接过多。
RedisNotEnoughConnections redis_connected_clients < 5 5 连接不足。
RedisRejectedConnections increase(redis_rejected_connections_total[1m]) > 0 5 连接被拒绝。

Prometheus监控告警规则相关推荐

  1. prometheus监控+告警

    1 开始安装前的准备 1.1 修改主机名 1.2 关闭防火墙 1.3 关闭seliunx 1.4 关闭防火墙 1.5 下载阿里云的yum源 2 下载所用到的包 2.1 安装 node_porter 2 ...

  2. prometheus监控告警功能

    prometheus监控K8S 监控告警功能 alertmanager邮箱告警配置 首先开通SMTP服务,QQ邮箱:设置–帐号–开通POP3/SMTP服务,记住生成的密码(其它邮箱同理) 编辑prom ...

  3. 自从上线了 Prometheus 监控告警,真香!

    点击上方蓝色"方志朋",选择"设为星标" 回复"666"获取独家整理的学习资料! 对很多人来说,未知.不确定.不在掌控的东西,会有潜意识的逃 ...

  4. 服务器运维监控指标,运维体系~指标监控~Prometheus监控告警与日志

    一 Prometheus 入门 1.1 入门介绍 运维体系~指标监控 先来一张图,说明一下Prometheus监控相关的软件和知识点. 1: 首先要安装:Prometheus, 负责收集各种监控指标, ...

  5. Prometheus监控告警

    监控告警-Prometheus 第一章:概述 本章将介绍监控告警的一些基本概念. 1.1 什么是监控告警? 监控是什么? 说白了就是用一种形式去盯着.观察服务器,把服务器的各种行为表现都显示出来,用以 ...

  6. Prometheus监控告警搭建(一)

    一.监控组件 监控需要的组件 alertmanager-0.21.0.linux-amd64.tar.gzgrafana-7.4.0.linux-amd64.tar.gzmysqld_exporter ...

  7. prometheus 监控告警安装与设置

    1.什么是Prometheus? Prometheus (普罗米修斯)是由 SoundCloud开发的开源监控报警系统和时序列数据库 . 2.Prometheus的特点 多维度数据模型. 灵活的查询语 ...

  8. 新型监控告警工具prometheus(普罗米修斯)入门使用(附视频讲解)

    作者: 李佶澳   转载请保留:原文地址   发布时间:2018/08/03 10:26:00 说明 Prometheus 命名规则 metric类型 Job和Instance 部署.启动 prome ...

  9. Prometheus+Grafana监控告警配置

    文章目录 Prometheus介绍 Prometheus及其组件安装 Prometheus安装 PromQL介绍 mysqld_exporter组件安装 node_exporter组件安装 alert ...

最新文章

  1. python 归一化_一文学会用python进行数据预处理
  2. tensorflow随笔-队列管理器QueueRunner-生产者与消费者
  3. java8 streams_使用Java 8 Streams进行编程对算法性能的影响
  4. angularjs1访问子组件_Vue学习笔记之组件的应用
  5. RPC 服务 与 HTTP 服务的区别
  6. 201904:Action recognition based on 2D skeletons extracted from RGB videos
  7. 页面跨域与iframe通信(Blocked a frame with origin)
  8. php中使用websocket
  9. 反应机理_介绍一种化学反应机理合成环戊酮
  10. 创建一个地震Viewer
  11. Nginx PageSpeed模块配置和使用
  12. 在Windows server 2019 Core 版本上安装SQL2016
  13. Win10系统下使用Setuna截图自动放大解决办法
  14. Window环境下 Jenkins Master/Slaver模式 + Svn 部署
  15. CSMA(carrier sense multiple access)
  16. rn 地图根据区名获取经纬度_React Native获取地理位置(获取具体城市、经纬度)...
  17. 开机就显示重启界面,Lenovo重装Win 10系统的解决办法之一
  18. Opencv-python 色相饱和度(HLS)
  19. python_17(sql)
  20. fir多相滤波器实现

热门文章

  1. prometheus定义counter指标
  2. EntityComponentSystemSamples学习笔记
  3. 入库管理系统示例代码
  4. 【shaderforge学习笔记】 Rotator节点
  5. 《状态变量分析导论》学习总结
  6. Word文档怎样修改纸张的方向?分享方法!word文档如何更改纸张的方向?
  7. 干货!生成模型的评价与诊断
  8. hdu3491 最小点割集(无向图求最小点割集通用方法)
  9. 基于STM32F429IGT6的NAND FLASH读写测试(CUBEMX)
  10. 好用的API接口测试工具有什么推荐吗?