Need help to configure email settings in Nagios? We can help you.
A proper email configuration will help us from spam or virus attacks. This documentation is to help you understand in detail how emails are sent by Nagios Log Server.
As part of our Server Management Services, we assist our customers with several Nagios Queries.
Today, let us see how to configure email settings in the Nagios log server.
Email settings in Nagios Log Server
Log Server, a powerful log monitoring and management application allows organizations to quickly view, sort, and configure logs from any source, on any given network.
If we have a log to monitor, Nagios Log Monitor can receive it for further analysis.
Furthermore, let us see how Nagios Log Server sends emails and the effective ways our Support Techs employ to configure them.
Nagios Log Server uses email to send alerts. Email settings in Nagios Log Server is in Admin > General > Mail Settings.
-
Web Browser Behavior
Generally, web browsers will auto-complete/auto-populate fields on a web page when it loads. Usually, this occurs when it sees a common field that does not have a value. It may already have a value for that “named field” and hence it populates that field.
For example, in the Mail Settings page in Nagios Log Server, when the Send Email Method selects SMTP Server, the username and password fields populate. This is simply our web browser trying to fill the data.
If we clear the username and password fields before clicking the Save Settings button, Nagios Log Server will correctly save those settings. Hence, it records that no username or password has been defined.
However, when the page refreshes, our web browser re-populate those fields as it thinks those values should go in there.
-
From & Reply-To
As we all know, these fields define where the email was sent from and the reply-to address.
The left field is the Display Name. The right field is the actual address and the format is:
alias@our.email.domain
We make sure this is a valid address so that when the receiver of the email clicks the reply button in their email client, then the reply-to address will be in use.
Configure email settings in Nagios
Nagios Log Server provides two methods for sending emails. Our Support Techs explains them in detail.
-
PHP Mail
This mail method uses Postfix to send an email. In the operating system, the command is sendmail.postfix
, which provides the ability for Postfix to accept Sendmail commands.
With this method, the Nagios Log Server is responsible for sending emails directly to all the recipients. It contacts the email server for the email recipient and sends the message via SMTP port 25.
However, certain issues may arise with email recipients that have spam/virus detection software.
If the receiving mail server detects that the email it receives is not from the mail server, it can discard it or move it to a junk mail folder.
PHP Mail as the method on the Mail Settings page requires no additional settings.
-
SMTP Server
SMTP Server as the method for sending email allows configuring Nagios Log Server to use an email server for mail delivery.
This could be an internal email server like Microsoft Exchange, Postfix, etc, or an external email server like Hosted email services, Internet Service Provider, etc.
An SMTP server for mail delivery is generally the more secure method.
The SMTP Server Address field is the network address of the SMTP server. We can use an IP address or DNS record.
However, SMTP Security is optional.
- Generally, SSL or TLS will encrypt the communication of the email.
- TLS is recommended over SSL mostly.
- STARTTLS offers a way to upgrade a plain text connection to an encrypted (SSL or TLS) connection.
- The mail server needs to support SSL or TLS.
The SMTP Port field is the network port the SMTP server is listening on. Common ports are 25 and 587.
The Username and Password fields are optional. All of this depends on how we configure the email server. This may require allowing mail relaying.
SMTP Example 1: Postfix, No Authentication, No Security
Consider the SMTP server as a Postfix server that allows connections from the Nagios Log Server IP address. It requires no authentication and security settings.
It is most likely because this Postfix server defines the IP address of the Nagios Log Server in the mynetworks
directive of the main.cf
file.
SMTP Example 2: Exchange, Authentication, No Security
Here, the SMTP server is an Exchange server that allows connections from the Nagios Log Server because it provides a username and password. No security settings have been chosen.
All it requires is the credentials for a user account with a mailbox and no changes on the Exchange server.
SMTP Example 3: Exchange, Authentication, Security
This is identical to example 2, however, it chose the security setting as TLS. This will ensure emails are sent encrypted.
Mail Relay
A mail relay is when we request the SMTP server to send emails to an email domain that it is not responsible for.
In order to prevent a rogue computer from using that SMTP server to send spam email, Email servers may configure to deny mail relay. Because it can result in the email server being blacklisted on the internet.
This can occur only if we do not provide a username and password in SMTP settings. Most SMTP servers will allow us to send emails to other domains when using authentication credentials.
Which Instance Sends The Email
Nagios Log Server consists of one or more instances of Nagios Log Server. When an alert email is being sent, it is sent by the instance that is running the alert.
From the Mail Settings page, we can send a test email. In this situation, it is the instance our web browser that connects to that will send the email.
[Stuck with email configuration? We’d be happy to assist]
Conclusion
To conclude, we saw how Nagios Log Server sends emails and the effective ways our Support Techs employ to configure them.
0 Comments