用Blackbox Exporter to Monitor web和端口
1.按照exporter
.wget https://github.com/prometheus/blackbox_exporter/releases/download/v0.12.0/blackbox_exporter-0.12.0.linux-amd64.tar.gz
.tar -zxf blackbox_exporter-0.12..linux-amd64.tar.gz
.mv blackbox_exporter-0.14..linux-amd64 /usr/local/blackbox_exporter
../blackbox_exporter --version
2.vim /lib/systemd/system/blackbox_exporter.service -- 变成系统服务 netstat -anptu|grep 9115
[Unit]
Description=blackbox_exporter
After=network.target [Service]
User=root
Type=simple
ExecStart=/usr/local/blackbox_exporter/blackbox_exporter --config.file=/usr/local/blackbox_exporter/blackbox.yml
Restart=on-failure [Install]
WantedBy=multi-user.target
3.监控web和端口状态
- job_name: web_status
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets: ['http://192.168.1.49:8080/']
labels:
instance: web_status
group: web
- targets: ['https://www.baidu.com/']
labels:
instance: baidu_status
group: baidu
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- target_label: __address__
replacement: 127.0.0.1:
- job_name: 'port_status'
metrics_path: /probe
params:
module: [tcp_connect]
static_configs:
- targets: ['192.168.1.49:8080']
labels:
instance: 'port_status'
group: 'tcp'
relabel_configs:
- source_labels: [__address__]
target_label: __param_target - target_label: __address__
replacement: 127.0.0.1:
4.dashboard -- 9665 和 7587
5.参考:https://blog.csdn.net/qq_43190337/article/details/100577728
6.监控端口和服务状态
- alert: NodePortavaibility
expr: probe_http_duration_seconds{} < 0.0000001
for: 2m
labels:
severity: warning
annotations:
summary: "{{$labels.instance}}: port-不可以-使用"
description: "{{$labels.instance}}: 端口响应时间大于 0.5us (当前值: {{ $value }})" - alert: Portisup
expr: probe_success{} !=
for: 2m
labels:
severity: warning
annotations:
summary: "{{$labels.instance}}: port-不可以-不等于1"
description: "{{$labels.instance}}: 端口结果不等于1 (当前值: {{ $value }})"
用Blackbox Exporter to Monitor web和端口的更多相关文章
- 无法启动Visual Studio的localhost web服务器,端口"xxxx"已被使用
解决方法:项目属性-Web里面有web服务器端口的设置,换个端口即可.项目属性->web->服务器,不要选择“自动分配端口”,选择“使用指定端口”,后面输入一个端口号
- 运行web项目端口占用问题
---恢复内容开始--- 有时候运行web项目会提示8080端口已经被占用这一类问题(Error running Tomcat8: Address localhost:1099 is already ...
- cocos web 多端口运行
cocos2d-js 也是比较普遍的游戏开发工具之一吧,今天想同时启动多个js项目来看下效果,结果百度不到添加端口的方法,又得去翻源码.... cocos run -p web 只要运行在本地就可以启 ...
- Linux 修改zabbix server的web访问端口
在安装zabbix server的时候默认就安装了apache,zabbix依靠apache提供的web服务,修改Zabbix的浏览器访问端口,就是修改apache的服务端口(默认端口:80) 1.编 ...
- nginx反向代理:两个域名指向不同web服务端口
一台服务器上安装了zabbix服务和jumpserver服务,两个域名zabbix.xxxx.xxxx和jumserver.xxx.xxxx 一.编辑/etc/nginx/conf.d目录下nginx ...
- 通过docker-composer启动容器nginx,并完成spring.boot的web站点端口转发
前面已经讲过2篇基于docker的mysql.redis容器编排并启动.这次将练习下nginx的docker方式的部署,以及通过nginx去代理宿主主机上的Web服务应该怎么配 PS:(这里由于ngi ...
- DLINK 企业路由器内网部署web开启端口转发后还需要开启是否支持端口回流功能
跑后台使用的服务器,配置一般都很低,带宽只有2Mb 一些大型文件比如app的更新包使用这种服务器不可行 但是公司的网络是100Mb对等静态ip专线 所以能利用起来,每年将会省下8万块 说干就干,这个步 ...
- Web端口复用正向后门研究实现与防御
0×01背景 现在的很多远控/后门因为目前主流防火墙规则的限制,基本上都采用TCP/UDP反弹回连的通讯形式:但是在较高安全环境下,尤其负责web相关业务的环境,因为安防设备(防火墙,IDS,IPS等 ...
- Docker实现GPA+Exporter监控告警系统
Docker实现GPA+Exporter监控告警系统 1.搭建grafana,prometheus,blackbox_exporter环境 # docker run -d -p 9090:9090 - ...
随机推荐
- 简单了解学习PHP(针对前端开发)
1.服务器(服务器系统) 通常是指较强的计算能力能够同时服务多人的计算机 常见的服务器操作系统: 1.各个版本的Linux操作系统 2.乌班图.centos 3.mac os(苹果) 4.windo ...
- python基于opencv实现人脸定位
import cv2 # 读取图片 img = cv2.imread("image.jpg") # 加载模型,模型可以从https://github.com/opencv/open ...
- More development resources
社区 名称 官网 google https://www.google.com/ github https://github.com/ StackOverflow https://stackoverfl ...
- MySQL认识索引
什么是索引? 索引在MySQL中也叫是一种“键”,是存储引擎用于快速找到记录的一种数据结构.索引对于良好的性能非常关键,尤其是当表中的数据量越来越大时,索引对于性能的影响愈发重要.索引优化应该是对查询 ...
- Contos 安装Tomcat
# 下载安装包 wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.40/bin/apache-tomcat-8. ...
- iOS UILabel显示HTML文本
NSString * htmlString = @"<html><body> Some html string \n <font size=\"13\ ...
- python并发——进程间同步和通信
一.进程间同步 对于一些临界资源,不能使用并发无限消耗,就需要设置专门的临界标示,比如锁或者信号量等 from multiprocessing import Process, Lock import ...
- python pip 使用
一.修改 pip 源 Windows 在用户目录下新建 pip\pip.ini 文件,如:C:\Users\Administrator\pip\pip.ini [global] index-url = ...
- vuejs2项目开发实战视频教程
0.课程大纲 一.点餐系统(移动) 1.0.课件 1.1.项目初始化_首页顶部 1.2.首页列表_底部导航 1.3.商家顶部_商家优惠信息弹层 1.4.商品主体_类别菜单 1.5.购物车操作_商品信息 ...
- Go项目的测试代码2(项目运用)
上一篇文章介绍了最基本的测试代码的写法.Go项目的测试代码(基础) 这里简单的共享一下我在项目中使用的方式. 项目结构 我们实际项目中, 结构简单地分了控制层controllers和模块层models ...