Hi,
We are trying to use Nagios core for monitoring and it is new to us.
Currently we tried to send notification mails from Nagios by using the default postfix mail daemon. For this modified some configuration in the main.cf file as suggested in forum. After restarting the postfix service trying to send mail notification manually by executing the below command and getting error message in maillog file. Also mail is not received.
Can you help me to understand the error and fix it. Thanks.
Command:
mail -s "Hello World" maheswari.k@intellectdesign.com
Error in maillog file:
Sep 13 11:58:24 NXTDEVNAGIOS postfix/smtp[27404]: E5E2D241B3: to=<maheswari.k@intellectdesign.com>, relay=none, delay=409, delays=409/0.07/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=intellectdesign.com type=MX: Host not found, try again)
Maheswari.K
Nagios Core - mail notification not working
-
- Posts: 4
- Joined: Tue Dec 20, 2016 12:31 pm
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Core - mail notification not working
I'm not sure what changes you made in your postfix config, but the error you received looks like it cannot resolve the MX record for
Can you verify you post the output of the following from your nagios server
and
Can you verify you post the output of the following from your nagios server
Code: Select all
cat /etc/resolv.conf
Code: Select all
dig intellectdesign.com MX
-
- Posts: 4
- Joined: Tue Dec 20, 2016 12:31 pm
Re: Nagios Core - mail notification not working
Hi,
Please find the output.
[root@NXTDEVNAGIOS ~]# cat /etc/resolv.conf
nameserver 172.18.20.20
nameserver 172.18.20.21
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@NXTDEVNAGIOS ~]# dig intellectdesign.com MX
; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> intellectdesign.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50149
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;intellectdesign.com. IN MX
;; AUTHORITY SECTION:
intellectdesign.com. 3600 IN SOA nxtidadds01.intellectdesign.com. hostmaster.intellectdesign.com. 1527149 900 600 86400 3600
;; Query time: 0 msec
;; SERVER: 172.18.20.20#53(172.18.20.20)
;; WHEN: Thu Sep 14 11:01:23 IST 2017
;; MSG SIZE rcvd: 107
Please find the output.
[root@NXTDEVNAGIOS ~]# cat /etc/resolv.conf
nameserver 172.18.20.20
nameserver 172.18.20.21
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@NXTDEVNAGIOS ~]# dig intellectdesign.com MX
; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> intellectdesign.com MX
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50149
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280
;; QUESTION SECTION:
;intellectdesign.com. IN MX
;; AUTHORITY SECTION:
intellectdesign.com. 3600 IN SOA nxtidadds01.intellectdesign.com. hostmaster.intellectdesign.com. 1527149 900 600 86400 3600
;; Query time: 0 msec
;; SERVER: 172.18.20.20#53(172.18.20.20)
;; WHEN: Thu Sep 14 11:01:23 IST 2017
;; MSG SIZE rcvd: 107
-
- Posts: 4
- Joined: Tue Dec 20, 2016 12:31 pm
Re: Nagios Core - mail notification not working
Hi,
Now we are able to send mail using the below command to out test mail server after doing some changes in main.cf and resolv.conf files.
command:
mail -s "Hello World" test1@development.com
Mail is going to our test mailbox. Checked the mail log also.
Sep 14 13:04:23 NXTDEVNAGIOS postfix/smtp[11496]: BB94D23A8D: to=<test1@development.com>, relay=172.16.103.179[172.16.103.179]:25, delay=4.9, delays=0.03/0.01/4.9/0, dsn=2.0.0, status=sent (250 Message accepted for delivery)
But the monitoring related alert mails are not getting delivered. When checked in mail log have seen the below error message.
Error:
Sep 14 13:08:02 NXTDEVNAGIOS postfix/postdrop[11513]: warning: mail_queue_enter: create file maildrop/58696.11513: Permission denied
Where to fx this permission problem.
Now we are able to send mail using the below command to out test mail server after doing some changes in main.cf and resolv.conf files.
command:
mail -s "Hello World" test1@development.com
Mail is going to our test mailbox. Checked the mail log also.
Sep 14 13:04:23 NXTDEVNAGIOS postfix/smtp[11496]: BB94D23A8D: to=<test1@development.com>, relay=172.16.103.179[172.16.103.179]:25, delay=4.9, delays=0.03/0.01/4.9/0, dsn=2.0.0, status=sent (250 Message accepted for delivery)
But the monitoring related alert mails are not getting delivered. When checked in mail log have seen the below error message.
Error:
Sep 14 13:08:02 NXTDEVNAGIOS postfix/postdrop[11513]: warning: mail_queue_enter: create file maildrop/58696.11513: Permission denied
Where to fx this permission problem.
Re: Nagios Core - mail notification not working
A few posts online with similar issues have recommended rebooting, or at least restarting the postfix/postdrop process again as it might still be holding on to the old permissions.
Former Nagios employee