Page 2 of 3
Re: Email notifications are missing
Posted: Mon May 09, 2016 8:17 pm
by absarcompass
OK excitement is killed.
I was getting the notification previously from
[email protected] and now getting from
[email protected]
smtp%20error%20for%20nagios%20notifications.PNG
Mail is coming from ON NET IP so, no authentication required at smtp level.
few google searches says it has something to do with php mailer (and i have no idea about it)
can you guys help me fix this

Re: Email notifications are missing
Posted: Tue May 10, 2016 9:38 am
by rkennedy
Can you post a screenshot of the 'Manage Email Settings' page? I'd like to take a look at your settings. Also please post
/usr/local/nagiosxi/tmp/phpmailer.log for us to look at.
To clarify -
I Have found the issue. Email Contact defined in Contact Group that I was using to get notified was not a NagiosXI user so, I have to use notify-host-by-email instead of xi_host_notification_handler under Alert Settings> Manage Host Notification Commands and for service notification too.
XI will use xi_host_notification_handler, which in turn depends on the manage email settings page (to decide if it should use smtp/sendmail). The notify-host-by-email will just send it right out with sendmail.
Looking at your profile, I noticed your load seems to get pretty high, which can cause problems all around. How many CPU's do you have allocated to this machine?
Code: Select all
[05-10-2016 07:04:30] NPCD: WARN: MAX load reached: load 10.240000/10.000000 at i=0
[05-10-2016 08:03:58] NPCD: WARN: MAX load reached: load 10.390000/10.000000 at i=0
[05-10-2016 08:04:13] NPCD: WARN: MAX load reached: load 10.180000/10.000000 at i=1
Re: Email notifications are missing
Posted: Tue May 10, 2016 4:58 pm
by absarcompass
Hi
thanks for the reply.
here is 'manage email setting'
manage email settings.PNG
I have tried removing username and password as we are not using any authentication.
phpmailer.log
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
SMTP Error: Data not accepted.<p>SMTP server error: 2.1.5 Ok
</p>
(method=smtp;host=smtp.compassnet.co.nz;port=25;security=none)
CPUs
nagiosxi tmp]# cat /proc/cpuinfo | grep 'core id'
core id : 0
core id : 1
core id : 0
core id : 1
Thanks
Re: Email notifications are missing
Posted: Wed May 11, 2016 9:41 am
by rkennedy
absarcompass wrote:
Mail is coming from ON NET IP so, no authentication required at smtp level.
few google searches says it has something to do with php mailer (and i have no idea about it)
can you guys help me fix this

You mentioned that no authentication is needed, but it looks like you're using the username 'nagiosadmin'. What happens if you clear out the credentials and try to send a test email?
Re: Email notifications are missing
Posted: Wed May 11, 2016 4:32 pm
by absarcompass
Hi
When i remove credentials and update settings credential come back again:S
althouth the security is checked as 'None'
Although test email works but no notification emails are passing.
Re: Email notifications are missing
Posted: Wed May 11, 2016 5:05 pm
by hsmith
Do you have access to your SMTP server's logs? It could be getting dropped for some reason or another.
Re: Email notifications are missing
Posted: Wed May 11, 2016 5:10 pm
by tgriep
In one of your earlier posts, you said that you are using contact only accounts.
Those will not work for you when the email method is set to SMTP like you are using.
For contact only accounts using SMTP for the mail method, you would have to follow this procedure.
Code: Select all
https://assets.nagios.com/downloads/nagiosxi/docs/Configuring-Core-Contacts-to-Use-Xi%27s-PHP-Mailer.pdf
Try that and see if that fixes it for you.
Re: Email notifications are missing
Posted: Wed May 11, 2016 5:18 pm
by absarcompass
I have checked the smtp servers. no logs are found for the notification emails
only test emails are in logs
Thanks for the phpmailer tweak, i'll look into it but the issue was that emails were working with current settings as far as i know i didn't change any thing but updated php and perl quite a few times to run some plugin that too with the help of this amazing forum:)
Re: Email notifications are missing
Posted: Wed May 11, 2016 9:35 pm
by absarcompass
Thanks tgriep
that link directed me in right direction.
We had those commands but with different values from the document you shared. I have changed the commands and now getting the email notifications but using the previous commands I was able to see smtp logs in
/var/log/maillog but now there are no smtp logs
Q1 so now where should I look for logs if i want to confirm whether nagios has send the notification email or not?
Q2 what document I have to follow if i want to use
xi_host_notification_handler instead of
notify_host_xi_contact?
Q3 although I can receive email notifications but still getting the same error in
/var/log/maillog
May 12 11:23:06 nagiosxi postfix/local[41437]: 9819A12C6: to=<
[email protected]>, relay=local, delay=0.01, delays=0/0/0/0, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. error writing message: File too large)
I have increased the mailbox and message size in postfix config
Thanks for your help guys:)
Cheers
Re: Email notifications are missing
Posted: Thu May 12, 2016 10:13 am
by tgriep
When you use SMTP as the Mailer Type in XI, it doesn't use Postfix to send email, it send it directly to the SNMP server and the messages in /var/log/maillog will not have any information on the Notifications from Nagios.
Q1. So see if a Notification was sent, you would look in the XI GUI and see that a notification was sent.
Then if there was an error, you would see in in the /usr/local/nagiosxi/tmp/phpmailer.log file. Only errors will be here, no logs if it was sent correctly.
Q2. If you want to use the xi_host_notification_handler, you will have to create a user account in the XI interface. That handler will use the email settings for the user account and not the Contact.
Take a look at this document for more details.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Q3. Those messages can be ignored for the most part. They are probably messages sent from the cron daemon but you would have to see what they are for sure.