prometheus+grafana+Alertmanager邮箱告警

环境

系统:CentOS 7
软件:alertmanager-0.18.0.linux-amd64.tar.gz

安装

  • 下载二进制包
    地址:https://prometheus.io/download/

  • 安装

    # tar -xzvf alertmanager-0.18.0.linux-amd64.tar.gz
    # mkdir /usr/local/prometheus # mv alertmanager-0.18.0.linux-amd64 /usr/local/prometheus/alertmanager 
  • 创建数据目录

    # mkdir -p /data/prometheus/alertmanager/data
    
  • 创建用户并授权

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

启动

  • 添加启动服务

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

    # systemctl enable alertmanager.service
    # systemctl start alertmanager.service 
  • 访问
    地址:http://ip:9093

你可能感兴趣的:(prometheus+grafana+Alertmanager邮箱告警)