Page 7 of 13

Re: contacts.cfg is not working properly

Posted: Tue Oct 13, 2015 11:46 am
by hsmith
You don't have any SMTP server in your environment? If you have your own email server on site, you should consult your sysadmin to see what you should be using for an SMTP server. Configuring postfix is going to be out of the scope of this forum. I can link you to this article which is likely applicable. https://www.digitalocean.com/community/ ... untu-14-04

Re: contacts.cfg is not working properly

Posted: Mon Oct 26, 2015 10:43 am
by sinkak
i don't understand why one of them is working and another one isnt. they both are using mail and both email address are in same domain. and no filters or restrictions on theme.

Code: Select all

define contact{
        contact_name                    wsawarn
        alias                                  WSAWarn
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,c,u
        host_notification_options       u,d
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           [email protected]
       }


define contact{
        contact_name                    wsacritical
        alias                                 WSACRITICAL
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    c
        host_notification_options       d
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        email                           [email protected]
        }

Re: contacts.cfg is not working properly

Posted: Mon Oct 26, 2015 3:22 pm
by hsmith
What is the output of the following command?

Code: Select all

grep inet_protocols /etc/postfix/main.cf

Re: contacts.cfg is not working properly

Posted: Tue Oct 27, 2015 11:52 am
by sinkak

Code: Select all

ubuntu@nagios-2015:~$ grep inet_protocols /etc/postfix/main.cf
inet_protocols = all
ubuntu@nagios-2015:~$

Re: contacts.cfg is not working properly

Posted: Tue Oct 27, 2015 12:06 pm
by hsmith
Can you change that to inet_protocols = ipv4, restart postfix, and try your mails again?

Re: contacts.cfg is not working properly

Posted: Tue Oct 27, 2015 2:42 pm
by sinkak
i did that change on postfix and restarted postfix and nagios.
still not working.

Re: contacts.cfg is not working properly

Posted: Tue Oct 27, 2015 2:43 pm
by hsmith
Can you post the mail log of it not working since making that change?

Re: contacts.cfg is not working properly

Posted: Tue Oct 27, 2015 3:42 pm
by sinkak

Code: Select all

tail -f /var/log/mail.log
Oct 27 20:32:36 nagios-2015 postfix/pickup[20365]: A72D042ABB: uid=106 from=<nagios>
Oct 27 20:32:36 nagios-2015 postfix/cleanup[23869]: A72D042ABB: message-id=<20151027203236.A72D042ABB@ip-10-0-10-149>
Oct 27 20:32:36 nagios-2015 postfix/qmgr[31700]: A72D042ABB: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Oct 27 20:32:36 nagios-2015 postfix/local[23872]: A72D042ABB: to=<root@ip-10-0-10-149>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 27 20:32:36 nagios-2015 postfix/qmgr[31700]: A72D042ABB: removed
Oct 27 20:37:36 nagios-2015 postfix/pickup[20365]: A359642ABB: uid=106 from=<nagios>
Oct 27 20:37:36 nagios-2015 postfix/cleanup[27320]: A359642ABB: message-id=<20151027203736.A359642ABB@ip-10-0-10-149>
Oct 27 20:37:36 nagios-2015 postfix/qmgr[31700]: A359642ABB: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Oct 27 20:37:36 nagios-2015 postfix/local[27323]: A359642ABB: to=<root@ip-10-0-10-149>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

Re: contacts.cfg is not working properly

Posted: Wed Oct 28, 2015 9:43 am
by hsmith

Code: Select all

Oct 27 20:37:36 nagios-2015 postfix/local[27323]: A359642ABB: to=<root@ip-10-0-10-149>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

Code: Select all

Oct 27 20:32:36 nagios-2015 postfix/local[23872]: A72D042ABB: to=<root@ip-10-0-10-149>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Those logs tell me that it is working, but you're sending to the same machine it is originating from...? I'm a little confused. Did you use the command to try to send the mail, or wait for Nagios to do it on its own?

Re: contacts.cfg is not working properly

Posted: Wed Oct 28, 2015 10:51 am
by sinkak
i am waiting for nagios to do it.
it is sending for warning email but not to critical mail.
That is the only problem.