Bobcares

Nagios email notification external SMTP | Guide

by | Mar 27, 2023

Learn how to configure Nagios email notification external SMTP. Our Server Management Support team is here to help you with your questions and concerns.

Nagios email notification external SMTP | Guide

Did you know that Nagios comes with a notification feature that is set to the local mail daemon (mail) by default?

However, this is not enough if the Nagios server’s IP is not designated to send emails. In this scenario, we can stick to utilities that support sending emails via an external SMTP server.

  1. First, we have to download and install sendemail.

    apt-get install sendmail

  2. Then, run the following commands to give the required authorization to write in the sendemail log file to help troubleshoot later on.

    touch /var/log/sendemail
    chmod 666 /var/log/sendemail

  3. Now, we have to open the resource.cfg file and add the following lines:

    $USER5$=email@domain.com
    $USER7$=smtp.server.com
    $USER9$=authsmtpusername $USER10$=authsmtpassword

  4. Then, save the file and exit.
  5. After that, take a backup of the config file:

    cd /usr/local/nagios/etc/objects/
    cp commands.cfg commands.cfg.old

  6. Then, we have to edit the commands.cfg file and locate the following commands:

    ‘notify-host-by-email‘ and ‘notify-service-by-email‘

  7. Next, if we use SMTP authentication, our experts suggest replacing the commands from the earlier step with the following:

    Nagios email notification external SMTP 1

    However, if we do not use SMTP authentication:

    Nagios email notification external SMTP 2

  8. Then, we have to run the following command before applying the new configuration:

    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

    or

    /etc/init.d/nagios configtest

If the above commands do not return any errors, restart the Nagios service.

Let us know in the comments if you need further help setting up Nagios email notification with external SMTP.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In summary, our Support Techs demonstrated how to configure Nagios email notification external SMTP.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.