DN42入坑指南(七)使用prometheus监控bird

第一:在bird2所在服务器上安装并启用bird_exporter(用于Prometheus控制它)

A:在bird2服务器(centos7)上安装go环境,并安装bird_exporter
    yum install go -y
    go get -u github.com/czerwonk/bird_exporter     #下载好的代码在当前目录下的go目录里面

B:修改bird2的日志记录方式
    vi /etc/bird.conf
timeformat protocol     iso long;

C:启动并写入开机自启
#启动
    /root/go/bin/bird_exporter -format.new=true -bird.v2 -bird.socket=/run/bird/bird.ctl &
#开机自启动
    echo "/root/go/bin/bird_exporter -format.new=true -bird.v2 -bird.socket=/run/bird/bird.ctl &" >> /etc/rc.local

D:启动完成后,会有一个metrics查看地址
    http://ip:9324/metrics

第二:在Prometheus配置文件中加入bird监控job

vi /root/prometheus/prometheus.yml

  - job_name: 'DN42-TTK'
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
    - targets: ['bird2_ip:9324']

    重载Prometheus,使其生效
    curl -X POST http://localhost:9090/-/reload
声明:本文为原创,作者为 辣条①号,转载时请保留本声明及附带文章链接:https://boke.wsfnk.com/archives/324.html
谢谢你请我吃辣条谢谢你请我吃辣条

如果文章对你有帮助,欢迎点击上方按钮打赏作者

最后编辑于:2022/11/30作者: 辣条①号

目标:网络规划设计师、系统工程师、ceph存储工程师、云计算工程师。 不负遇见,不谈亏欠!

暂无评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

arrow grin ! ? cool roll eek evil razz mrgreen smile oops lol mad twisted wink idea cry shock neutral sad ???

文章目录