Sending test notification fails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Sending test notification fails

Post by WillemDH »

Hello,

What can I do to troubleshoot failed test notifications? I'm posting this in General Forum, as it's an issue on my private XI instance on my Linode server. It seems unable to send email to my gmail address.

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Sending test notification fails

Post by jdalrymple »

It starts with checking on how your sending?

Sendmail or SMTP?

Have you looked at /var/log/maillog for either:

a) outgoing messages?
b) bounce messages?

Typically the easiest thing to do with XI is configure a known good SMTP server, as in one you are able to successfully configure on your iPhone and send mail from using the same settings that you pump into XI. If you have a good set of creds on a good SMTP server, that is almost always foolproof. I'm sure you've already seen it, but in case not:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Sending test notification fails

Post by WillemDH »

Well unfortunately I do not have a known good SMTP server running. At work, I do have it configured with an SMTP server and it works fine.
So I configured Nagios to use Sendmail in the mail settings in the Admin menu. /var/log/maillog is completely empty.

Tried a bit debugging from cli but I don't get any error or info that would get me any further.

Code: Select all

➜  ~  echo "Your message" | mail -s "Message Subject"  [email protected]
➜  ~  echo "Your message" | mailx -s "Message Subject"  [email protected]

Code: Select all

 telnet mail.messaging.microsoft.com 25
Trying 207.46.163.247...
Connected to mail.messaging.microsoft.com.
Seems to work, so outgoing mail should be no problem?

Any advice is welcome to get this working. Cheerz.

WIllem
Nagios XI 5.8.1
https://outsideit.net
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Sending test notification fails

Post by jdalrymple »

WillemDH wrote:

Code: Select all

➜  ~  echo "Your message" | mail -s "Message Subject"  [email protected]
➜  ~  echo "Your message" | mailx -s "Message Subject"  [email protected]
Weird - this worked but sendmail is not working? Are you able to even see your notifications in the notifications view, or is it possible that Nagios isn't sending them at all?

enable_notifications=1 in nagios.cfg?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Sending test notification fails

Post by lmiltchev »

/var/log/maillog is completely empty.
Willem, is rsyslog running? It would be helpful to have something in the maillog in order to troubleshoot the issue. Can you try restarting rsyslog and sendmail?

Code: Select all

service rsyslog restart
service sendmail restart
Then try sending an email again from the CLI and check the maillog.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Sending test notification fails

Post by WillemDH »

Willem, is rsyslog running? It would be helpful to have something in the maillog in order to troubleshoot the issue.

Code: Select all

 sudo systemctl status rsyslog
[sudo] password for willemdh:
rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled)
   Active: active (running) since Sat 2015-08-08 19:45:34 CEST; 1 day 22h ago
 Main PID: 2663 (rsyslogd)
   CGroup: /system.slice/rsyslog.service
           └─2663 /usr/sbin/rsyslogd -n

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
I restarted it to get rid of the warning:

Code: Select all

sudo systemctl restart rsyslog
➜  ~  sudo systemctl status rsyslog
rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled)
   Active: active (running) since Mon 2015-08-10 17:50:18 CEST; 2s ago
 Main PID: 15827 (rsyslogd)
   CGroup: /system.slice/rsyslog.service
           └─15827 /usr/sbin/rsyslogd -n

Aug 10 17:50:18 f1reoutside systemd[1]: Started System Logging Service.
Weird - this worked but sendmail is not working? Are you able to even see your notifications in the notifications view, or is it possible that Nagios isn't sending them at all?
Sorry Jdalrymple if wasn't clear. I just wanted to mention I tried with these cli commands but they also failed.

Is it possible I'm not using 'sendmail' on CentOS 7 but 'mailx'?

Code: Select all

yum list installed | grep "mail"
fail2ban-sendmail.noarch         0.9.2-1.el7                           @epel
mailcap.noarch                   2.1.41-2.el7                          @base
mailx.x86_64                     12.5-12.el7_0                         @base
Should I install sendmail? Looking at the core notification command I would think if I get /bin/mail to work the core notification handlers should work?

I can see this is not really a Nagios issue, so I posted my question on the Linode forum (https://forum.linode.com/viewtopic.php? ... 070#p68070) and the CentOS forum (https://www.centos.org/forums/viewtopic ... 48&t=53692)

Grtz

Willem
Nagios XI 5.8.1
https://outsideit.net
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Sending test notification fails

Post by jdalrymple »

WillemDH wrote:Sorry Jdalrymple if wasn't clear. I just wanted to mention I tried with these cli commands but they also failed.
Bingo - sorry I misunderstood. If that failed it is a network restraint being imposed somewhere between your machine and your Internet routable interface. SMTP is usually the simple answer - you can use a Gmail account, it will just appear to be coming from [email protected] - for testing (which it seems you're doing now?) this should be fine though.
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Sending test notification fails

Post by WillemDH »

Nice tip I'll try the gmail option. I'll let you know how that goes.
Nagios XI 5.8.1
https://outsideit.net
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Sending test notification fails

Post by tgriep »

Let us know how it works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Sending test notification fails

Post by WillemDH »

The gmail option worked out. Please close.
Nagios XI 5.8.1
https://outsideit.net
Locked