Blackbox exporter安装

环境

系统:CentOS 7.5
软件:blackbox_exporter-0.12.0.linux-amd64.tar.gz

安装

  • 下载二进制包
    地址:https://github.com/prometheus/blackbox_exporter/releases

  • 安装

    # tar -xzvf blackbox_exporter-0.12.0.linux-amd64.tar.gz
    # mkdir /usr/local/prometheus
    # mv blackbox_exporter-0.12.0.linux-amd64 /usr/local/prometheus/blackbox_exporter
    
  • 创建用户并授权

    # useradd prometheus
    # chown -R prometheus:prometheus /usr/local/prometheus
    

启动

  • 添加启动服务

    # vim /usr/lib/systemd/system/blackbox_exporter.service
    [Unit]
    Description=blackbox_exporter
    After=network.target
    
    [Service]
    Type=simple
    User=prometheus
    ExecStart=/usr/local/prometheus/blackbox_exporter/blackbox_exporter --config.file=/usr/local/prometheus/blackbox_exporter/blackbox.yml
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
  • 启动

    # systemctl enable blackbox_exporter.service
    # systemctl start blackbox_exporter.service
    
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容