Changes between Version 2 and Version 3 of NSM2021/Agenda/AlertsIcinga2Email


Ignore:
Timestamp:
May 16, 2021, 4:31:44 PM (3 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NSM2021/Agenda/AlertsIcinga2Email

    v2 v3  
    77By default, Icinga supports email notifications, but we need to configure an email server on the Icinga node as it will be using the Linux mail utilities for sending the mails.
    88
     9During the initial installation, we installed `postfix`. Now we need to add google credentials to it so that your server can send mails using Google.
     10
     11Edit `/etc/postfix/main.cf`
     12
     13Change following. ( DO NOT copy paste these in to the end of the file )
     14
     15{{{
     16
     17# TLS parameters
     18smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
     19smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
     20smtpd_tls_security_level=may
     21
     22smtp_tls_CApath=/etc/ssl/certs
     23smtp_tls_security_level=may
     24smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
     25
     26relayhost = [smtp.gmail.com]:587
     27smtp_use_tls = yes
     28smtp_sasl_auth_enable = yes
     29smtp_sasl_security_options =
     30smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
     31smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
     32
     33}}}
     34
     35Create `/etc/postfix/sasl_passwd` with your Google username and password
     36
     37{{{
     38[smtp.gmail.com]:587 thilinapathiedulk@gmail.com:MyPassw)<#
     39}}}
     40
     41where `MyPassw)<#` would be my password for google. On google you have to make sure, Less Secure Apps are enabled.
     42
     43now restart postfix
     44
     45`systemctl restart postfix`
     46
     47Test mail transport by `mail -s "Hello World" youremail@yourdomain.tld`
     48