contacts.cfg is not working properly

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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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]
        }
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

What is the output of the following command?

Code: Select all

grep inet_protocols /etc/postfix/main.cf
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

Code: Select all

ubuntu@nagios-2015:~$ grep inet_protocols /etc/postfix/main.cf
inet_protocols = all
ubuntu@nagios-2015:~$
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Can you change that to inet_protocols = ipv4, restart postfix, and try your mails again?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post by sinkak »

i did that change on postfix and restarted postfix and nagios.
still not working.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post by hsmith »

Can you post the mail log of it not working since making that change?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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)
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: contacts.cfg is not working properly

Post 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?
Former Nagios Employee.
me.
sinkak
Posts: 158
Joined: Thu Jul 30, 2015 1:30 pm

Re: contacts.cfg is not working properly

Post 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.
Locked