现在环境是这样:

ceph 4台:

192.168.100.21  ceph-node1

192.168.100.22  ceph-node2

192.168.100.23  ceph-node3

192.168.100.25  ceph-node5

#已经部署好一个ceph cluster 集群    四个 osd  三个mon   没有使用块存储所有没有mod

监控服务端一台

192.168.100.26  Grafana  上面都是以容器部署了

Prometheus: 
Grafana: 
alertmanager: 
prometheus-webhook-alert:
cAdvisor:

docker-compose 编排如下:

version: ""
networks:
monitor:
driver: bridge
services:
prometheus:
image: prom/prometheus
container_name: prometheu
hostname: prometheu
restart: always
volumes:
- /Prometheus/config/prometheus.yml:/etc/prometheus/prometheus.yml
- ./config/alertmanager-rule.yml:/etc/prometheus/alertmanager-rule.yml
- /etc/localtime:/etc/localtime
ports:
- "9090:9090"
networks:
- monitor prometheus-webhook-alert:
image: timonwong/prometheus-webhook-dingtalk:v0.3.0
container_name: prometheus-webhook-alertmanagers
hostname: webhook-alertmanagers
restart: always
volumes:
- /etc/localtime:/etc/localtime
ports:
- "8060:8060"
entrypoint: /bin/prometheus-webhook-dingtalk --ding.profile="webhook1=https://****#钉钉webhook自己去申请一个"
networks:
- monitor alertmanager:
image: prom/alertmanager
container_name: alertmanager
hostname: alertmanager
restart: always
volumes:
- ./config/alertmanager.yml:/etc/alertmanager/alertmanager.yml
- /etc/localtime:/etc/localtime
ports:
- "9093:9093"
networks:
- monitor grafana:
image: grafana/grafana
container_name: grafana
hostname: grafana
restart: always
volumes:
- /etc/localtime:/etc/localtime
- ./grafana-piechart:/var/lib/grafana/plugins/grafana-piechart-panel
ports:
- "3000:3000"
networks:
- monitor cadvisor:
image: google/cadvisor:latest
container_name: cadvisor
hostname: cadvisor
restart: always
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /etc/localtime:/etc/localtime
ports:
- "8080:8080"
networks:
- monitor

几处关键配置文件如下:

#普罗米修斯配置文件

 cat   ./config/prometheus.yml

# my global config
global:
scrape_interval: 15s # Set the scrape interval to every seconds. Default is every minute.
evaluation_interval: 15s # Evaluate rules every seconds. The default is every minute. # Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets: ["192.168.100.26:9093"]
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "alertmanager-rule.yml" scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.100.26:9090'] - job_name: 'cadvisor-1'
static_configs:
- targets: ['192.168.100.26:8080'] - job_name: 'node-1'
scrape_interval: 4s
static_configs:
- targets: ['192.168.100.26:9100'] - job_name: 'cadvisor-2'
static_configs:
- targets: ['192.168.100.25:8080'] - job_name: 'node-2'
scrape_interval: 4s
static_configs:
- targets: ['192.168.100.25:9100'] - job_name: 'ceph'
scrape_interval: 4s
static_configs:
- targets: ['192.168.100.21:9128']

#监控报警组件 压制 合并 过滤配置文件 并配置webhook地址

cat  ./config/alertmanager.yml

global:
resolve_timeout: 5m
route:
group_by: ['alertname']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
receiver: 'web.hook' receivers:
- name: 'web.hook'
webhook_configs:
- url: 'http://192.168.100.26:8060/dingtalk/webhook1/send'
send_resolved: true inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname', 'dev', 'instance']

#监控报警规则配置文件

cat ./alertmanager-rule.yml

groups:
- name: ceph-rule
rules:
- alert: Ceph OSD Down
expr: ceph_osd_down >
for: 2m
labels:
product: Ceph测试集群
annotations:
Warn: "{{$labels.instance}}: 有{{ $value }}OSD,down: {{$labels}}"
Description: "{{$labels.instance}}:有{{ $labels.osd }}当前状态为{{ $labels.status }}" - alert: 集群空间使用率
expr: ceph_cluster_used_bytes / ceph_cluster_capacity_bytes * >
for: 2m
labels:
product: Ceph测试集群
annotations:
Warn: "{{$labels.instance}}:集群空间不足"
Description: "{{$labels.instance}}:当前空间使用率为{{ $value }}"

node-exporter:  json模板下载   https://grafana.com/grafana/dashboards/10645

cadvisor:  json模板下载:  https://grafana.com/grafana/dashboards/3125

ceph cluster:  json模板下载:   https://grafana.com/grafana/dashboards/917%5D

最后来一张完成  成果图

docker-compose 快速部署Prometheus之服务端并监控ceph cluster 使用钉钉webhook 报警的更多相关文章

  1. 使用 Docker Compose 快速构建 TiDB 集群

    本文档介绍如何在单机上通过 Docker Compose 快速一键部署一套 TiDB 测试集群.Docker Compose 可以通过一个 YAML 文件定义多个容器的应用服务,然后一键启动或停止. ...

  2. 快速理解高性能HTTP服务端的负载均衡技术原理(转)

    1.前言 在一个典型的高并发.大用户量的Web互联网系统的架构设计中,对HTTP集群的负载均衡设计是作为高性能系统优化环节中必不可少的方案.HTTP负载均衡的本质上是将Web用户流量进行均衡减压,因此 ...

  3. Docker Compose 一键部署LNMP

    Docker Compose 一键部署LNMP 目录结构 [root@localhost ~]# tree compose_lnmp/ compose_lnmp/ ├── docker-compose ...

  4. Docker Compose 一键部署Nginx代理Tomcat集群

    Docker Compose 一键部署Nginx代理Tomcat集群 目录结构 [root@localhost ~]# tree compose_nginx_tomcat/ compose_nginx ...

  5. Docker Compose 一键部署多节点爬虫程序

    Docker Compose 一键部署多节点爬虫程序 目录结构 [root@localhost ~]# tree compose_crawler/ compose_crawler/ ├── cento ...

  6. 用Docker swarm快速部署Nebula Graph集群

    用Docker swarm快速部署Nebula Graph集群 一.前言 本文介绍如何使用 Docker Swarm 来部署 Nebula Graph 集群. 二.nebula集群搭建 2.1 环境准 ...

  7. 通过 DynamicLinq 简单实现 N-Tier 部署下的服务端数据库通用分页

    通过 DynamicLinq 简单实现 N-Tier 部署下的服务端数据库通用分页 YbSoftwareFactory 的 YbRapidSolution for WinForm 插件使用CSLA.N ...

  8. docker-compose 快速部署Prometheus,监控docker 容器, 宿主机,ceph -- cluster集群

    话不多说上菜: 现在环境是这样: ceph 4台: 192.168.100.21  ceph-node1 192.168.100.22  ceph-node2 192.168.100.23  ceph ...

  9. 如何快速部署 Prometheus?- 每天5分钟玩转 Docker 容器技术(85)

    上一节介绍了 Prometheus 的核心,多维数据模型.本节演示如何快速搭建 Prometheus 监控系统. 环境说明 我们将通过 Prometheus 监控两台 Docker Host:192. ...

随机推荐

  1. zip 多维

    ll=zip([[1,3],[2,4]],[[88,99],[66,55]])a=zip(*ll)# print(list(a)) #[([1, 3], [2, 4]), ([88, 99], [66 ...

  2. WCF 数据传输SIZE过大

    1.当客户端调用WCF服务时,接受数据过大,可通过以下配置解决 <basicHttpBinding> <binding name="BasicHttpBinding_Wcf ...

  3. 【协作式原创】查漏补缺之Golang中mutex源码实现

    概览最简单版的mutex(go1.3版本) 预备知识 主要结构体 type Mutex struct { state int32 // 指代mutex锁当前的状态 sema uint32 // 信号量 ...

  4. vmware fusion nat网络模式设置固定ip

    最近想在本地用虚拟环境搭一个k8s环境,但是发现虚拟机的ip会不定时自动变化,导致mosh客户端连接经常中断.于是就想让虚拟机的ip固定住,不再变动. mac 上的 vmware fusion 设置固 ...

  5. python中:from * import 与 import 详解

    在python 中导入模块是我们最常用的功能,基本每个.py 文件中都会有 import 或者是 from * import 语句,可是,这两种方法有什么不同,有该怎么用?今天就好好分析一下. 先上定 ...

  6. treap(堆树)

    # 2018-09-27 17:35:58 我实现的这个treap不能算是堆.有问题 最近对堆这种结构有点感兴趣,然后想用指针的方式实现一个堆而不是利用数组这种结构,于是自己想到了一个用二叉树结构实现 ...

  7. js中的arguments、Array.prototype.slice.call()

    类数组对象:arguments js把传入到这个函数的全部参数存储在arguments里面,其实arguments也是个对象,而且是一个特殊的对象,它的属性名是按照传入参数的序列来的,第1个参数的属性 ...

  8. SSM项目中,关于Test类中不能使用Autowired注入bean的问题

    在测试类中使用AutoWired注解一直不能获取到Bean,调用方法时一直报空指针异常,我有在其他类中使用AutoWired试了下,发现能够生效.问题应该就是处在Test类中,后面找了半天终于找到问题 ...

  9. 「Violet」蒲公英

    「Violet」蒲公英 传送门 区间众数,强制在线. 分块经典题. 像这题一样预处理,然后就直接爆搞,复杂度 \(O(n \sqrt n)\) 参考代码: #include <algorithm ...

  10. Centos7 之 MariaDB(Mysql) root密码忘记的解决办法

    MariaDB(Mysql) root密码忘记的解决办法 1.首先先关闭mariadb数据库的服务 # 关闭mariadb服务命令(mysql的话命令就是将mariadb换成mysql) [root@ ...