setting up openshift alert manager mail alerting based on critical and warning
Configure alert manager to send mail. This will send mail to 2 diffrent groups
one is managemnet group for ciritical alerts only and second is default group for all alerts.
$ oc project openshift-monitoring
The secret file where alertmanager.yaml content ( encoded in base64 ) will remain is alertmanager-main
convert the yaml content into base64 first
$ cat alertmanager.yaml | base64 -w0
copy value
now edit secret
$ oc edit secret alertmanager-main
find value starts with
alertmanager.yaml:
replace all base64 content from your own . save and exit
now in order to take this secret in effect we must bounce the pod
$ oc delete po -l alertmanager=main
check if all pod came online
$ oc get po -l alertmanager=main
done!
alertmanager.yaml content
- name: deadmansswitch
--note change value of your mail server and from mailid and to mail id
one is managemnet group for ciritical alerts only and second is default group for all alerts.
$ oc project openshift-monitoring
The secret file where alertmanager.yaml content ( encoded in base64 ) will remain is alertmanager-main
convert the yaml content into base64 first
$ cat alertmanager.yaml | base64 -w0
copy value
now edit secret
$ oc edit secret alertmanager-main
find value starts with
alertmanager.yaml:
replace all base64 content from your own . save and exit
now in order to take this secret in effect we must bounce the pod
$ oc delete po -l alertmanager=main
check if all pod came online
$ oc get po -l alertmanager=main
done!
alertmanager.yaml content
resolve_timeout: 5m |
route: |
group_wait: 30s |
group_interval: 5m |
repeat_interval: 12h |
receiver: default |
routes: |
- match: |
alertname: DeadMansSwitch |
repeat_interval: 5m |
receiver: deadmansswitch |
- match: |
severity: critical |
receiver: itops |
receivers: |
- name: default |
email_configs: |
- send_resolved: true |
# Whether or not to notify about resolved alerts. |
# The email address to send notifications to. |
to: [email protected] |
# The sender address. |
from: [email protected] |
# The SMTP host through which emails are sent. |
smarthost: 192.168.1.5:25 |
# The hostname to identify to the SMTP server. |
hello: localmail.mevijay.com |
# The SMTP TLS requirement. |
require_tls: false |
- name: itops |
email_configs: |
- send_resolved: true |
# Whether or not to notify about resolved alerts. |
# The email address to send notifications to. |
to: [email protected] |
# The sender address. |
from: [email protected] |
# The SMTP host through which emails are sent. |
smarthost: 192.168.1.5:25 |
# The hostname to identify to the SMTP server. |
hello: localmail.mevijay.com |
# The SMTP TLS requirement. |
require_tls: false |
global: |
--note change value of your mail server and from mailid and to mail id
Comments
Post a Comment