Page 1 of 2

How to configure a mail server to send nagios notifications

Posted: Tue Jul 14, 2015 4:43 pm
by Jessuzz94
Im using CentOS and i want to configure postfix or sendmail to send notifications with a gmail account. Where i can find some tutorial? Thanks

Re: How to configure a mail server to send nagios notificati

Posted: Wed Jul 15, 2015 9:17 am
by jdalrymple
Using Postfix or Sendmail to relay through Gmail is tricky. It's easier to just send straight to your mail relay from Nagios.

These are the appropriate instructions:

https://exchange.nagios.org/directory/A ... on/details

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 2:08 pm
by Jessuzz94
The tutorial said:

Code: Select all

Testing: 
Go into Nagios and send an alert and check the /var/log/sendEmail log file. It should say "Email was sent successfully". 
it means that one email account is sent to another email account?

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 2:13 pm
by Jessuzz94
And the notifications is sending to the email account that i putted in contacts.cfg?

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 2:23 pm
by jdalrymple
Jessuzz94 wrote:it means that one email account is sent to another email account?
More accurately - it means that the sendEmail program sent mail to an email account.
Jessuzz94 wrote:And the notifications is sending to the email account that i putted in contacts.cfg?
That is how it's supposed to work.

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 2:29 pm
by Jessuzz94
Jessuzz94 wrote:And the notifications is sending to the email account that i putted in contacts.cfg?
That is how it's supposed to work.[/quote]

oviously, sorry, but, the email account that use sendemail to send to the email configured in contacts.cfg is the email configured in resource.cfg where the turorial says?:

Code: Select all

1) Edit /usr/local/nagios/etc/resource.cfg - add (3) new entries. 
$USER5$=your_isp_email_address 
$USER6$=your_isp_email_password 
$USER7$=your_isp_outgoing_mail_server 

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 2:32 pm
by jdalrymple
The reason for the additional resource.cfg entries is because you're trying to send mail through a SMTP server such as mail.google.com or mail.yahoo.com. This will not work unless you authenticate with a valid user on those servers.

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 3:34 pm
by Jessuzz94
you mean a authentication like a certificate?

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 3:56 pm
by jdalrymple
https://en.wikipedia.org/wiki/SMTP_Authentication

Very common way to prevent rogue mailers from causing spam. It's as simple as a username and a password to be allowed to send mail.

You cannot send gmail without a username and password
You cannot send yahoo mail without a username and password

Understand?

Re: How to configure a mail server to send nagios notificati

Posted: Thu Jul 16, 2015 4:25 pm
by Jessuzz94
Yes, sorry