45Drives Knowledge Base
KB450245 – Configuring Alertmanager to send Emails
https://knowledgebase.45drives.com/kb/kb450245-configuring-alertmanager-to-send-emails/

KB450245 – Configuring Alertmanager to send Emails

Posted on October 19, 2020 by Rob MacQueen


Scope/Description

Prerequisites

Steps

# vim /etc/alertmanager/alertmanager.yml
global:
  resolve_timeout: 5m

  smtp_smarthost: 'emailserverhostname:port'

  smtp_from: 'fromemail@example.com'

  smtp_require_tls: false

route:
  group_by: 
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 1h
  receiver: 'ceph-dashboard'
receivers:
- name: 'ceph-dashboard'
  webhook_configs:
  - url: 'http://osd1:8443/api/prometheus_receiver'
  - url: 'http://osd2:8443/api/prometheus_receiver'
  - url: 'http://osd3:8443/api/prometheus_receiver'
  - url: 'http://osd4:8443/api/prometheus_receiver'
  email_configs:
   - to: 'exampleaddress@example.com'

# systemctl restart alertmanager

Verification

# systemctl status alertmanager

Troubleshooting

# docker logs alertmanager
KB450245 – Configuring Alertmanager to send Emails – 45Drives Knowledge Base
Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450245 – Configuring Alertmanager to send Emails

You are here:

Scope/Description

  • This article will show proper syntax in order to allow emails to be sent from alert manager

Prerequisites

  • A running Ceph Cluster with the ceph dashboard configured with ceph-ansible
  • Access to the cluster ansible-admin node
  • An email address, mail server name and port you wish to send the alerts to

Steps

  • Log in to the ansible admin node and edit “/etc/alertmanager/alertmanager.yml”
[root@osd1 ~]# vim /etc/alertmanager/alertmanager.yml
global:
  resolve_timeout: 5m

  smtp_smarthost: 'emailserverhostname:port'

  smtp_from: 'fromemail@example.com'

  smtp_require_tls: false

route:
  group_by: ['alertname']
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 1h
  receiver: 'ceph-dashboard'
receivers:
- name: 'ceph-dashboard'
  webhook_configs:
  - url: 'http://osd1:8443/api/prometheus_receiver'
  - url: 'http://osd2:8443/api/prometheus_receiver'
  - url: 'http://osd3:8443/api/prometheus_receiver'
  - url: 'http://osd4:8443/api/prometheus_receiver'
  email_configs:
   - to: 'exampleaddress@example.com'

  • Restart the alert manager service:
[root@osd1 ~]# systemctl restart alertmanager

Verification

  • Check the status of alert manager to ensure the service is running:
[root@osd1 ~]# systemctl status alertmanager

Troubleshooting

  • If the alert manager service is failing you can check the logs for alert manager:
[root@osd1 ~]# docker logs alertmanager
  • Pay close attention to syntax in the alertmanager.yml file. It is very common for the service to fail due to a syntax error.
Was this article helpful?
Dislike 0
Views: 274
© 2021 - 45Drives Knowledge Base
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access