NMIS8 Email
Configure the email section to allow NMIS to send out emails. The settings are straight forward, the mail server to use, the domain the email is coming from, the email address the email should come from an and option to combine emails so notifications about devices are grouped instead of sent individually.
- System -> System Configuration -> NMIS Configuration, choose "email" from the drop down.
If you are using the local host (127.0.0.1) to deliver mail there are a couple of things to remember. Make sure you have the mail daemon running, on CentOS the default is sendmail:
sudo chkconfig --list sendmail # sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off # enable sendmail by default sudo chkconfig sendmail on # double check that it will be started sudo chkconfig --list sendmail # sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off # now start the daemon so we can use it right away sudo service sendmail start
If you leave sendmail with it's default configuration it will need a DNS server to resolve domain names for it. If you don't have DNS setup you will find that emails will be stuck in mail queues. To check this you can try:
# to see if there is mail in the mail queue sudo mailq # if you take a look at one of the pieces of mail you will likely find something like this (with your domain name instead of ours) (host map: lookup (opmantek.com): deferred)
You have some options to fix this, here we show how to quickly setup the dnsmasq daemon, you can also disable the DNS requirement and/or enable SMART_HOST, see http://stackoverflow.com/questions/43970/configuring-sendmail-behind-a-firewall). As long as your server can currently resolve names (pinging a named host works, ie ping google.com) then this should fix the problem:
yum install dnsmasq chkconfig dnsmasq on service dnsmasq start
Send a test email
The script <nmis_base>/admin/testmail.pl will send an email to the default user contact1. If you would like to send a test email edit the contact1 contact and set the email address (if your not sure how to do this see the contacts section) . Then run the script:
/usr/local/nmis8/admin/testemail.pl # This script will send a test email to the contact contact1 user@opmantek.com # Using the configured email server 127.0.0.1 # 07:44:37 sendEmail to=user@opmantek.com subject=Normal Priority Test Email from NMIS8 # <snip>
The emails should show up in the inbox you specified shortly after running the script. If they don't try using the mailq command above, or check out http://www.electrictoolbox.com/show-sendmail-mail-queue/