大家好,波哥又来给大家推荐好东西啦!
cloud_dns_exporter 是一个开源的 Prometheus Exporter,用于从云服务提供商(如阿里云、腾讯云等)获取 DNS 解析记录,并将这些数据导出到 Prometheus 进行监控和分析。其主要目的是帮助用户监控其 DNS 解析记录的变化,以便及时发现并解决问题。
克隆项目
git clone https://github.com/eryajf/cloud_dns_exporter.git
cd cloud_dns_exporter
编译项目
使用 Go 编译项目:
go build -o cloud_dns_exporter
配置文件
创建并编辑配置文件 config.yaml,配置云服务提供商和 API 密钥等信息:
aliyun:
access_key_id: "your-access-key-id"
access_key_secret: "your-access-key-secret"
tencent:
secret_id: "your-secret-id"
secret_key: "your-secret-key"
运行 Exporter
启动 cloud_dns_exporter:
./cloud_dns_exporter --config.file=config.yaml
配置 Prometheus
在 Prometheus 配置文件中添加 cloud_dns_exporter:
scrape_configs:
- job_name: 'cloud_dns_exporter'
static_configs:
- targets: ['localhost:9119']
重启 Prometheus 以加载新的配置
产品截图
项目地址:
https://github.com/eryajf/cloud_dns_exporter
觉得不错别忘了给波哥一键三连哦!