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.
- First, we have to download and install sendemail.
apt-get install sendmail
- 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 - Now, we have to open the resource.cfg file and add the following lines:
$USER5$=email@domain.com
$USER9$=authsmtpusername $USER10$=authsmtpassword
$USER7$=smtp.server.com - Then, save the file and exit.
- After that, take a backup of the config file:
cd /usr/local/nagios/etc/objects/
cp commands.cfg commands.cfg.old - Then, we have to edit the commands.cfg file and locate the following commands:
‘notify-host-by-email‘ and ‘notify-service-by-email‘
- Next, if we use SMTP authentication, our experts suggest replacing the commands from the earlier step with the following:
However, if we do not use SMTP authentication:
- 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.
0 Comments