12.prometheus监控之Domain域名过期监控
一、域名过期时间监控
域名的监控通过domain_exporter来完成
domain_exporter:https://github.com/caarlos0/domain_exporter/releases
二、domain_exporter安装
2.1 源码安装方法
https://prometheus.io/download/
wget https://github.com/caarlos0/domain_exporter/releases/download/v1.20.0/domain_exporter_1.20.0_linux_amd64.tar.gz tar zxvf domain_exporter_1.20.0_linux_amd64.tar.gz
mkdir /opt/prometheus -p
mv domain_exporter_1.20.0_linux_amd64 /opt/prometheus/domain_exporter # 创建用户,并给文件夹授权
useradd -M -s /usr/sbin/nologin prometheus
chown prometheus:prometheus -R /opt/prometheus #创建systemd服务
cat <<"EOF" >/etc/systemd/system/domain_exporter.service
[Unit]
Description=domain_exporter
After=network.target [Service]
Type=simple
User=prometheus
Group=prometheus
ExecStart=/opt/prometheus/domain_exporter/domain_exporter
Restart=on-failure [Install]
WantedBy=multi-user.target
EOF # 启动
systemctl daemon-reload
systemctl start domain_exporter
systemctl enable domain_exporter
2.2 docker安装方式
docker run -d --restart=always --name domain_exporter -p 9222:9222 caarlos0/domain_exporter
3.Prometheus设置
cd /data/docker-prometheus
cat >> prometheus/prometheus.yml <<"EOF"
- job_name: domain
#scrape_interval: 1h
scrape_interval: 15s
metrics_path: /probe
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: 192.168.10.100:9222 # domain_exporter address
static_configs:
- targets:
- qq.com
- baidu.cn
EOF # 重新加载配置
curl -X POST http://localhost:9090/-/reload # 检查
http://192.168.10.100:9222/
http://192.168.10.14:9090/targets?search=
3.1 常用监控项目
domain_expiry_days 域名到期时间
domain_probe_success 域名检测状态
4.domain触发器(告警规则)
cat >> prometheus/rules/domain.yml <<"EOF"
groups:
- name: domain
rules:
- alert: 域名检测失败
expr: domain_probe_success == 0
for: 2h
labels:
severity: warning
annotations:
summary: '{{ $labels.instance }}'
description: '{{ $labels.domain }}域名检测失败'
- alert: 域名过期
expr: domain_expiry_days < 30
for: 2h
labels:
severity: warning
annotations:
summary: '{{ $labels.instance }}'
description: '{{ $labels.domain }}将在30天后过期'
- alert: 域名过期
expr: domain_expiry_days < 5
for: 2h
labels:
severity: page
annotations:
summary: '{{ $labels.instance }}'
description: '{{ $labels.domain }}将在5天后过期'
EOF
重新加载配置:
curl -X POST http://localhost:9090/-/reload
检查:
http://192.168.10.14:9090/rules
http://192.168.10.14:9090/alerts?search=
4.grafana dashboard图形展示
https://grafana.com/grafana/dashboards/14605
id14605显示域名不正确,需要修改
instance修改为domain
https://grafana.com/grafana/dashboards/13924-9116-domain/

12.prometheus监控之Domain域名过期监控的更多相关文章
- Prometheus监控学习笔记之Prometheus普罗米修斯监控入门
0x00 概述 视频讲解通过链接网易云课堂·IT技术快速入门学院进入,更多关于Prometheus的文章. Prometheus是最近几年开始流行的一个新兴监控告警工具,特别是kubernetes的流 ...
- shell+curl监控网站页面(域名访问状态),并利用sedemail发送邮件
应领导要求,对公司几个主要站点的域名访问情况进行监控.下面分享一个监控脚本,并利用sendemail进行邮件发送. 监控脚本如下:下面是写了一个多线程的网站状态检测脚本,直接从文件中读出站点地址,然后 ...
- [转]Prometheus 与 Grafana 实现服务器运行状态监控
http://flintx.me/2017/12/12/Prometheus%20+%20Grafana%20%E5%AE%9E%E7%8E%B0%E6%9C%8D%E5%8A%A1%E5%99%A8 ...
- shell+curl监控网站页面(域名访问状态),并利用sendemail发送邮件
应领导要求,对公司几个主要站点的域名访问情况进行监控.下面分享一个监控脚本,并利用sendemail进行邮件发送. 监控脚本如下:下面是写了一个多线程的网站状态检测脚本,直接从文件中读出站点地址,然后 ...
- 《为什么说 Prometheus 是足以取代 Zabbix 的监控神器?》
为什么说 Prometheus 是足以取代 Zabbix 的监控神器? Kuberneteschina 致力于提供最权威的 Kubernetes 技术.案例与Meetup! 关注他 12 人赞同 ...
- prometheus operator(Kubernetes 集群监控)
一.Prometheus Operator 介绍 Prometheus Operator 是 CoreOS 开发的基于 Prometheus 的 Kubernetes 监控方案,也可能是目前功能最全面 ...
- Prometheus+Grafana+Alertmanager搭建全方位的监控告警系统
prometheus安装和配置 prometheus组件介绍 1.Prometheus Server: 用于收集和存储时间序列数据. 2.Client Library: 客户端库,检测应用程序代码,当 ...
- Prometheus(一):Web服务环境监控
写在前面 现每个后端的同学的日常都在跟服务(接口)打交道,维护老的比较大单体应用.按业务拆得相对比较细的新服务.无论企业内部用的,面向用户的前端的服务.流量大的有流量小的,有重要的有不那么重要的. 但 ...
- Zabbix监控Low level discovery实时监控网站URL状态
今天我们来聊一聊Low level discovery这个功能,我们为什么要用到loe level discovery这个功能呢? 很多时候,在使用zabbix监控一些东西,需要对类似于Itens进行 ...
- 【DB宝41】监控利器PMM的使用--监控MySQL、PG、MongoDB、ProxySQL等
目录 一.PMM简介 二.安装使用 三.监控MySQL数据库 MySQL慢查询分析 四.监控PG数据库 五.监控MongoDB数据库 六.监控ProxySQL中间件 一.PMM简介 之前发布过一篇Pr ...
随机推荐
- 记录--CSS 滚动驱动动画 scroll()
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 CSS 滚动驱动动画 scroll() animation-timeline 通过 scroll() 指定可滚动元素与滚动轴来为容器动画提 ...
- golang gc的内部优化
今天讲一个常见的gc compiler(也就是官方版本的go编译器和runtime)在垃圾回收的扫描标记阶段做的优化. 我对这个优化的描述印象最深的是在bigcache的注释里,大致内容是如果map的 ...
- FPGA中的面积优化
FPGA中的面积优化 一.优化的意义 面积优化,就是在实现预定功能的情况下,使用更小的面积.通过优化,可以使设计能够运行在资源较少的平台上,节约成本,也可以为其他设计提供面积资源. 二.操作符平衡 对 ...
- 慢查询SQL排查
转载请注明出处️ 作者:测试蔡坨坨 原文链接:caituotuo.top/c56bd0c5.html 你好,我是测试蔡坨坨. 在往期文章中,我们聊过数据库基础知识,可参考「数据库基础,看完这篇就够了! ...
- Android---ListView控件用法
首先要使用ListView是要自定义一个适配器类的,先简单分析一下适配器怎么写: 示例程序是要使用ListView列表显示出水果的图片以及对应的水果文字描述(水果名字). public class F ...
- Vue入门笔记一
<Vue.js项目实战>Guillaume Chau Vue核心功能概述 1.一个响应式的数据系统,能通过轻量级的虚拟DOM引擎和最少的优化工作来自动更新用户界面 2.灵活的视图声明,包括 ...
- #插头dp#洛谷 5074 HDU 1693 Eat the Trees
题目 给出 \(n*m\) 的方格,有些格子不能铺线, 其它格子必须铺,可以形成多个闭合回路. 问有多少种铺法? \(n,m\leq 12\) 分析 设 \(dp[n][m][S][0/1]\) 表示 ...
- #启发式合并,LIS,平衡树#洛谷 4577 [FJOI2018]领导集团问题
题目 在一棵树上选择最多的点,使得存在祖先关系的点满足\(w_x\leq w_y\),其中\(x\)是\(y\)的祖先 分析 祖先链上要满足\(LIS\),考虑将子节点的LIS序列合并至节点\(x\) ...
- 拥抱开源更省钱「GitHub 热点速览」
免费.低成本.自托管.开源替代品...这些词就是本周的热门开源项目的关键字.常见的 AI 提升图片分辨率的工具,大多是在线服务或者调用接口的客户端,而「Upscaler」是一款下载即用的免费 AI 图 ...
- 报表格式太难?一文教你Excel融合分析
Excel是我们最经常使用的处理报表工具了,尤其是金融行业更是需要天天和报表打交道.但是Excel有一个问题,如果面对的数据庞杂,则处理起来就会相当麻烦,当需要从多个数据源获取数据来制作一个报表时,这 ...