Difference between revisions of "Pandora: Configuration emails alerts"
(Created page with '= Quick email setup guide for alerts in Pandora FMS = == Email configuration with a Gmail account == In order to configure pandora FMS to send alerts through Gmail, you need to…') |
(→Email configuration with a Gmail account) |
||
Line 3: | Line 3: | ||
== Email configuration with a Gmail account == | == Email configuration with a Gmail account == | ||
− | In order to configure pandora FMS to send alerts through Gmail, | + | In order to configure pandora FMS to send alerts through Gmail, Pandora and Postfix must be configured this way: |
=== Pandora's Configuration === | === Pandora's Configuration === |
Revision as of 14:22, 20 May 2013
Contents
1 Quick email setup guide for alerts in Pandora FMS
1.1 Email configuration with a Gmail account
In order to configure pandora FMS to send alerts through Gmail, Pandora and Postfix must be configured this way:
1.1.1 Pandora's Configuration
In order to properly configure your email with a Gmail account, all the fields must be commented in the Pandora FMS server configuration file(/etc/pandora/pandora_server.conf) except the mta_address field, which will be configured with the IP server or localhost (where the postfixserver is installed).
If Postfix is installed in the same server than Pandora FMS, the configuration in the pandora_server.conf would be like that:
mta_address localhost #mta_port 25 #mta_user [email protected] #mta_pass mypassword #mta_auth LOGIN #mta_from Pandora FMS <[email protected]>
Now, I would like to show you briefly how to configure an alert in the Pandora FMS console.
1.1.1.1 Action Setup
To set the mail recipient you should use the mail action to XXX so you can add an email recipient to which all the mail alerts will be sent.
1.1.1.2 Alert setup
In this case, the module configuration has been generated in the module configuration> Alerts, a new alert with the module that you can see in the screenshot below.
Once the alert is fired, you can see how the alert reaches the e-mail picked in the action:
1.1.2 Postfix Setup
1-- Edit the /etc/postfix/main.cf file and add the following lines at the end of the file:
relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd smtp_sasl_security_options = noanonymous smtp_use_tls = yes smtp_tls_CAfile = /etc/postfix/cacert.pem
2-- Create the /etc/postfix/sasl/passwd file with the content below:
[ACCOUNT]@gmail.com:[PASSWORD]
Protect it accordingly through:
chmod 600 /etc/postfix/sasl/passwd
3-- Transform /etc/postfix/sasl/passwd into a hash type indexed file through the following instruction:
postmap /etc/postfix/sasl/passwd
It will crete the /etc/postfix/sasl/passwd.db file:
4-- Before taking the next step, you should check that the ca-certificate package (that will have the Gmail certification) is installed. Certificates will be installed in the /etc/ssl/certs path by default.
In order to add the Equifax certificating authority (which certifies emails from Gmail) to the certificate file that postfix uses, run the following command in a root console:
cat /etc/ssl/certs/Equifax_Secure_CA.pem > /etc/postfix/cacert.pem
5 - Finally, restart postfix to apply the changes:
/etc/init.d/postfix restart
6 - You can verify the performance by opening two consoles. You should execute the following command in one of them to monitor the behavior of the mail:
tail -f /var/log/mail.log
You can send an email through the other one:
echo "Prueba correo" | mail [email protected]
If you have done everything right, something like that should appear in the other console:
Dec 18 18:33:40 OKComputer postfix/pickup[10945]: 75D4A243BD: uid=0 from= Dec 18 18:33:40 OKComputer postfix/cleanup[10951]: 75D4A243BD: message-id= Dec 18 18:33:40 OKComputer postfix/qmgr[10946]: 75D4A243BD: from=, size=403, nrcpt=1 (queue active) Dec 18 18:33:44 OKComputer postfix/smtp[10953]: 75D4A243BD: [email protected], relay=smtp.gmail.com[74.125.93.109]:587, delay=3.7, delays=0.15/0.14/1.8/1.6, dsn=2.0.0, status=sent (250 2.0.0 OK 1324249500 eb5sm36008464qab.10) Dec 18 18:33:44 OKComputer postfix/qmgr[10946]: 75D4A243BD: removed
If the result is like the one above, Pandora will have been properly configured and linked to the Postfix server, so it will send mails as expected.