These instructions are for legacy NEMS deployments only (NEMS 1.1 to 1.2.x). If you are using NEMS 1.3+, please visit the current documentation.
A step-by-step guide to configuring Email Notifications on your NEMS Server.
Configure your resource.cfg
sudo nano /etc/nagios3/resource.cfg
Modify all the variables according to your configuration. To save, press CTRL-O, to exit press CTRL-X.
When using Gmail for SMTP, a few extra steps are required.
First, if you are a G Suite user (that is to say, you're using Gmail but have an @yourdomain.com email address on their service as opposed to an @gmail.com address), visit this page and configure the SMTP Relay Service like this:
Of course, if you happen to have a static public IP address on your NEMS server, go ahead and enable IP filtering for even more security.
Then, visit this page and enable “Allow users to manage their access to less secure apps”.
Now that you've done that, or if you are not a G Suite user, you'll need to enable the setting for “less secure apps” here: https://myaccount.google.com/lesssecureapps
I've written an easy-to-use script which will load your settings from resource.cfg and send you a test email. It will also show you in the terminal the results, which may be helpful if you believe there is an error (since you'll be able to see the output of sendemail).
To run the test script:
sudo nems-mailtest email@example.com
where [email protected] is your actual recipient email address (must be different than the one you set in resource.cfg).
Configuring notifications in NEMS (or Nagios for that matter) requires a knowledge of what the single-character options mean. Here is an overview:
When you see w,u,c,r,f,n these are the definitions:
When you see d,u,r,f,s,n these are the definitions: