Page 1 of 1

Mail Notification is not working

Posted: Fri Feb 01, 2019 6:32 am
by amitgupta19
I have installed the Nagios 4 on CentOS 7.

I am using the mailx to send the notifications.

Suddenly mail notifications are working for me.

i have attached the commands.cfg and contacts.cfg file .

Do let me know if anything else is required.

Re: Mail Notification is not working

Posted: Fri Feb 01, 2019 9:37 am
by scottwilkerson
Do the notifications show up in the Notification Report in the Nagios GUI?

Do the notifications show up in the maillog?

Code: Select all

tail -50 /var/log/maillog
Is postfix running?

Code: Select all

systemctl status postfix

Re: Mail Notification is not working

Posted: Fri Feb 01, 2019 11:59 am
by amitgupta19
Yes Notification is showing in the GUI Console Under the Notifications.

Yes i can see in the maillog following are the logs:
===============================================
Feb 1 08:34:20 cblnagios01 postfix/pickup[10997]: 62DDD408830F: uid=1005 from=<nagios>
Feb 1 08:34:20 cblnagios01 postfix/cleanup[15052]: 62DDD408830F: message-id=<[email protected]>
Feb 1 08:34:20 cblnagios01 postfix/qmgr[18247]: 62DDD408830F: from=<[email protected]>, size=820, nrcpt=1 (queue active)
Feb 1 08:34:20 cblnagios01 postfix/smtp[15054]: 62DDD408830F: to=<[email protected]>, orig_to=<nagios@localhost>, relay=172.16.5.13[172.16.5.13]:25, delay=0.09, delays=0.01/0/0.01/0.08, dsn=2.0.0, status=sent (250 2.0.0 2qaxe8tfyd-1 Message accepted for delivery)
Feb 1 08:34:20 cblnagios01 postfix/qmgr[18247]: 62DDD408830F: removed
==================================================

Postfix is running on the server.

Nagios is using the email/contact as "nagiosadmin". But when i see in the Configuration-->Hosts in the Nagios Console. It shows the the contact (AmitGupta)as i have defined.

Why the mail is not getting triggered for the contact that i have defined for the hosts?

Please suggest.

Re: Mail Notification is not working

Posted: Fri Feb 01, 2019 12:10 pm
by scottwilkerson
can you confirm that the contact AmitGupta has been set in the host/service definition?

Re: Mail Notification is not working

Posted: Tue Feb 05, 2019 11:59 am
by amitgupta19
Thanks scottwilkerson .

Now i have solved the Issue.

It was due to that contact was not defined for the service.

Re: Mail Notification is not working

Posted: Tue Feb 05, 2019 12:07 pm
by scottwilkerson
amitgupta19 wrote:Thanks scottwilkerson .

Now i have solved the Issue.

It was due to that contact was not defined for the service.
Excellent, glad it is resolved!

Locking thread