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.
Mail Notification is not working
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Mail Notification is not working
- Attachments
-
- contacts.cfg
- Contacts.cfg
- (2.07 KiB) Downloaded 149 times
-
- commands.cfg
- Commands.cfg
- (7.15 KiB) Downloaded 166 times
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Mail Notification is not working
Do the notifications show up in the Notification Report in the Nagios GUI?
Do the notifications show up in the maillog?
Is postfix running?
Do the notifications show up in the maillog?
Code: Select all
tail -50 /var/log/maillog
Code: Select all
systemctl status postfix
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Mail Notification is not working
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.
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Mail Notification is not working
can you confirm that the contact AmitGupta has been set in the host/service definition?
-
- Posts: 286
- Joined: Fri Sep 08, 2017 5:53 am
Re: Mail Notification is not working
Thanks scottwilkerson .
Now i have solved the Issue.
It was due to that contact was not defined for the service.
Now i have solved the Issue.
It was due to that contact was not defined for the service.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Mail Notification is not working
Excellent, glad it is resolved!amitgupta19 wrote:Thanks scottwilkerson .
Now i have solved the Issue.
It was due to that contact was not defined for the service.
Locking thread