I've recently upgraded from Nagios xi 5.x to 5.8 and in this process had to migrate from Centos 6 to 7.
Thus got the new Centos 7 VMware image from the Nagios website and restored a backup.
Everything seems to working fine and I can also send a test mail from the Nagios GUI, but when an host goes down there is no message send (or at least not received )
Do you have a service or host you can play with to force a notification to be sent?
For example sometimes I set up a service for "number of users", then set the warning and critical settings at 1 and 2.
Then I log in to that server via ssh in 3 different sessions to force a critical alert. Make sure you set up the notification
for this alert to email you.
When you do that and see the alert, get the /var/log/maillog file and send it to me.
Also grab a System Profile for me:
To send us your system profile.
1. Login to the Nagios xi GUI using a web browser.
2. Click the "Admin" > "System Profile" Menu
3. Click the "Download Profile" button
4. Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.
The /var/spool/root log files is mailing as root@mydomain.lan to root@mydomain.lan.
This is wrong I suppose, but not sure how to fix this. The hostname is set via nmtui.
The testmail button works fine. Perhaps there is an additional config file that is missing some data?
Your old system likely had a relayhost added to /etc/postfix/main.cf to relay properly for contacts that use notify-host-by-email and notify-service-by-email commands.
Does your SMTP server require authentication (username and password)?
The old system is still accessible indeed.
The output looks quite similar.
[root@VCAMSSV24 ~]# alternatives --display mta
mta - status is auto.
link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
slave mta-pam: /etc/pam.d/smtp.postfix
slave mta-mailq: /usr/bin/mailq.postfix
slave mta-newaliases: /usr/bin/newaliases.postfix
slave mta-rmail: /usr/bin/rmail.postfix
slave mta-sendmail: /usr/lib/sendmail.postfix
slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.postfix.
Configuring Sendmail and SMTP on the GUI both works when pressing the 'Send a Test Email' button. Our spamfilters and SPF records are set up propery and allow for this to be properly received.
Except when an alert is triggered.
/etc/postfix/main.cf on the old system is also pretty default.
The send a test email button will use PHPMailer, the contacts using notify-host-by-email and notify-service-by-email will not and requires the backend MTA be setup.
Please do a diff of this file from both servers, they are both setup to use postfix on the backend: