Mail Notification is not working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Mail Notification is not working

Post 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.
Attachments
contacts.cfg
Contacts.cfg
(2.07 KiB) Downloaded 149 times
commands.cfg
Commands.cfg
(7.15 KiB) Downloaded 166 times
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mail Notification is not working

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Mail Notification is not working

Post 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=<20190201163420.62DDD408830F@cblnagios02.gia.global>
Feb 1 08:34:20 cblnagios01 postfix/qmgr[18247]: 62DDD408830F: from=<nagios@cblnagios02.gia.global>, size=820, nrcpt=1 (queue active)
Feb 1 08:34:20 cblnagios01 postfix/smtp[15054]: 62DDD408830F: to=<nagios@localhost.gia.global>, 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mail Notification is not working

Post by scottwilkerson »

can you confirm that the contact AmitGupta has been set in the host/service definition?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
amitgupta19
Posts: 286
Joined: Fri Sep 08, 2017 5:53 am

Re: Mail Notification is not working

Post by amitgupta19 »

Thanks scottwilkerson .

Now i have solved the Issue.

It was due to that contact was not defined for the service.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Mail Notification is not working

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked