积木别倒

  • 首页
  • 科学上网
  • 机场推荐
  • 网站搭建
  • 网站分享
  • 其他
记录、分享
小白折腾之路
  1. 首页
  2. 科学上网
  3. 正文

[转载]监控你的机场链路质量(Windows)

8月 18, 2022 83点热度 0人点赞 0条评论

机场稳定性监测Smokeping 作为链路质量监控是非常完美的选择,但是因为我只有一台 Windows 所以选择了 Grafana + prometheus + blackbox exporter 来监控 VPS 的链路质量,发现也可以用来监控机场各个节点的链路状态。

下载 Grafana (本教程使用9.1.0 的 OSS Windows版本) https://grafana.com/grafana/download?edition=oss&pg=get&platform=windows&plcmt=selfmanaged-box1-cta1

下载 Prometheus(本教程使用 2.36.2.windows-amd64) 和 Blackbox_exporter (本教程使用 0.21.1.windows.amd64) https://prometheus.io/download/

配置 Clash:

本人使用 Clash for Windows,所以需要先在 Settings 里面关闭 Random Controller Port,然后在 General 里 Home Directory 点击 Open Folder 打开目录,修改 config.yaml:

external-controller: 127.0.0.1:3703 #监听地址和端口
secret: 41e42810-0958-4132-980f-15c97f1313bd #密钥,没有可以在 clash for windows 里的Settings 里 Core Secret 点击 Update

在 blackbox.yml 里添加:

  http_clash_speedtest:
    prober: http
    timeout: 5s
    http:
      method: GET
      headers:
        Authorization: Bearer 41e42810-0958-4132-980f-15c97f1313bd

创建 prometheus-clash-nodelist.yml , targets 填写所有节点的 clash 测速 api:

- targets:
  - 'http://127.0.0.1:3703/proxies/🇭🇰 IEPL-SS香港1/delay?timeout=5000&url=https://www.gstatic.com/generate_204'
  labels:
    instance: 'SS香港1'
    module: http_clash_speedtest

- targets:
  - 'http://127.0.0.1:3703/proxies/🇭🇰 IEPL-SS香港2/delay?timeout=5000&url=https://www.gstatic.com/generate_204'
  labels:
    instance: 'SS香港2'
    module: http_clash_speedtest

修改 prometheus.yml:

scrape_configs:
  - job_name: 'Clash'
    metrics_path: /probe
    scrape_interval: 5s
    file_sd_configs:
      - files:
          - 'prometheus-clash-nodelist.yml' 
    relabel_configs:
      - source_labels: [module]
        target_label: __param_module
      - source_labels: [__address__]
        target_label: __param_target
      - target_label: __address__
        replacement: 127.0.0.1:9115  

可以通过 CMD 运行 Blackbox_exporter 和 Prometheus,如正常运行则可以在浏览器进入 localhost:9090 点击 Status → Target 看到我们刚才添加的节点运行状况。Prometheus 默认保留 15 天的数据,可以添加 --storage.tsdb.retention.time=365d 来进行更长时间的监控,配合 WINSW 创建服务以持久化的运行。

Grafana 默认使用端口 3000,可以在 conf 目录下复制 defaults.ini 重命名为 custom.ini 并修改自定义端口:

# The http port to use
http_port = 3001

启动完成后浏览器进入 localhost:3001,默认账户密码 admin,登录后在左下角进入Configuration, 点击 Add data source 添加 Prometheus 数据库, HTTP 的 URL 栏填写 http://localhost:9090 即可,Prometheus 可以通过 --web.listen-address=:9091 修改默认端口

添加好数据库后在 Dashboard 里导入 这个面板 就可以了,默认使用中位数测量延迟,显示丢包(只代表时间内有丢包情况,详细的丢包率可以看下面的 packet loss)。

原文链接:https://app.simplenote.com/p/QHld2x

本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: 机场稳定性监测
最后更新:8月 18, 2022

积木

这个人很懒,什么都没留下

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

Telegram
📢 频道:积木别倒
🏄 群组:翻墙交流群
最新 热点 随机
最新 热点 随机
[转载]监控你的机场链路质量(Windows) 听说速蛙云机场跑路了,怎么才选到稳定靠谱的机场呢? Macbook 安装 homebrew 教程 2022 年9个订阅链接转换网站推荐 8个购买非国区 Apple ID 和 GV 号的地方 谈谈几个自用翻墙机场:主力稳定,备用便宜
一键脚本快速搭建Snell v2.0 代理服务 | Surge 和Shadowrocket 配置Snell 教程 华硕 RT-AX56U 现已支持梅林固件 2023 年10个 telegram 成人福利开车频道、群组推荐(18禁) centos7手动搭建shadowsocks服务,支持aes-256-gcm FFmpeg windows10 系统安装使用与常用命令 使用一键脚本搭建shadowsocks服务
归档
  • 2022年8月
  • 2022年7月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年1月
  • 2020年11月
  • 2020年10月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2019年9月
  • 2019年8月
  • 2019年4月
  • 2019年3月
标签聚合
wordpress Docker 中转线路 FFmpeg 翻墙机场 shadowsocks mtg 一键脚本 Google Voice IEPL 在线书签 telegram Trojan 美区Apple ID mtproxy 腾讯AIA

COPYRIGHT © 2022 jimubiedao.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang