Page 11 of 13

Re: contacts.cfg is not working properly

Posted: Tue Nov 03, 2015 3:09 pm
by hsmith

Code: Select all

Nov  3 19:10:43 nagios-2015 postfix/smtp[12827]: DCA2342AD5: to=<[email protected]>, relay=smtp17.msoutlookonline.net[64.78.22.100]:25, delay=0.49, delays=0.02/0/0.28/0.19, dsn=5.5.2, status=bounced (host smtp17.msoutlookonline.net[64.78.22.100] said: 504 5.5.2 <nagios@ip-10-0-10-149>: Sender address rejected: need fully-qualified address (in reply to RCPT TO command))

Try this command and let me know what happens.

Code: Select all

echo "test nagios email" | /usr/bin/mail -a "From:[email protected]" -s "Test" [email protected]
I'm assuming your website isn't actually "website.com" (if it is, nice one!). Change @website.com in this command to whatever your domain actually is.

If that does not work, please post the log of it not working.

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:12 am
by sinkak

Code: Select all

echo "test nagios email" | /usr/bin/mail -a "From:[email protected]" -s "Test" [email protected]

tail -f /var/log/mail.log

Nov  4 16:06:59 nagios-2015 postfix/qmgr[31700]: 2C6E342F29: removed
Nov  4 16:07:09 nagios-2015 postfix/pickup[15350]: 7F68642AC8: uid=1000 from=<ubuntu>
Nov  4 16:07:09 nagios-2015 postfix/cleanup[26637]: 7F68642AC8: message-id=<20151104160709.7F68642AC8@ip-10-0-10-149>
Nov  4 16:07:09 nagios-2015 postfix/qmgr[31700]: 7F68642AC8: from=<ubuntu@ip-10-0-10-149>, size=322, nrcpt=1 (queue active)
Nov  4 16:07:09 nagios-2015 postfix/smtp[26639]: 7F68642AC8: to=<[email protected]>, relay=smtp17.msoutlookonline.net[64.78.22.100]:25, delay=0.38, delays=0.01/0/0.27/0.11, dsn=5.5.2, status=bounced (host smtp17.msoutlookonline.net[64.78.22.100] said: 504 5.5.2 <ubuntu@ip-10-0-10-149>: Sender address rejected: need fully-qualified address (in reply to RCPT TO command))
Nov  4 16:07:09 nagios-2015 postfix/cleanup[26637]: F004342F29: message-id=<20151104160709.F004342F29@ip-10-0-10-149>
Nov  4 16:07:09 nagios-2015 postfix/bounce[26640]: 7F68642AC8: sender non-delivery notification: F004342F29
Nov  4 16:07:09 nagios-2015 postfix/qmgr[31700]: 7F68642AC8: removed
Nov  4 16:07:09 nagios-2015 postfix/qmgr[31700]: F004342F29: from=<>, size=2315, nrcpt=1 (queue active)
Nov  4 16:07:09 nagios-2015 postfix/local[26641]: F004342F29: to=<ubuntu@ip-10-0-10-149>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 16:07:09 nagios-2015 postfix/qmgr[31700]: F004342F29: removed
Nov  4 16:07:12 nagios-2015 postfix/pickup[15350]: CAE2542AC8: uid=106 from=<nagios>
Nov  4 16:07:12 nagios-2015 postfix/cleanup[26637]: CAE2542AC8: message-id=<20151104160712.CAE2542AC8@ip-10-0-10-149>
Nov  4 16:07:12 nagios-2015 postfix/qmgr[31700]: CAE2542AC8: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Nov  4 16:07:12 nagios-2015 postfix/local[26641]: CAE2542AC8: to=<root@ip-10-0-10-149>, orig_to=<root>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 16:07:12 nagios-2015 postfix/qmgr[31700]: CAE2542AC8: removed
i think even though we specified from address it is taking sender address as ubuntu@ip-10-0-10-149

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:23 am
by hsmith
Do you have any control over whatever smtp17.msoutlookonline.net is coming from?

Can we see the contents of your main.cf file?

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:30 am
by rkennedy
Can you post the mail headers of one of your warning emails that is working properly?

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:41 am
by sinkak
hsmith wrote: Can we see the contents of your main.cf file?

Code: Select all

ubuntu@nagios-2015:~$ more  /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = nagios-2015
mydomain = localdomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost, localhost.localdomain, localhost, ip-10-0-10-149
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/32
mailbox_size_limit = 0
recipient_delimiter = +
#inet_interfaces = all
inet_interfaces = all
#inet_protocols = all
inet_protocols = ipv4

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:54 am
by sinkak
rkennedy wrote:Can you post the mail headers of one of your warning emails that is working properly?
from the command line it is failing for both warning email and alerts email.
But from nagios UI alerts are coming to warning email address.

Code: Select all

Nov  3 23:57:15 nagios-2015 postfix/qmgr[31700]: 9C5FC42AD5: removed
Nov  4 00:02:15 nagios-2015 postfix/pickup[9287]: 9859542AD5: uid=106 from=<nagios>
Nov  4 00:02:15 nagios-2015 postfix/cleanup[18581]: 9859542AD5: message-id=<20151104000215.9859542AD5@ip-10-0-10-149>
Nov  4 00:02:15 nagios-2015 postfix/qmgr[31700]: 9859542AD5: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Nov  4 00:02:15 nagios-2015 postfix/local[18583]: 9859542AD5: 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=se
nt (delivered to mailbox)
Nov  4 00:02:15 nagios-2015 postfix/qmgr[31700]: 9859542AD5: removed
Nov  4 00:07:15 nagios-2015 postfix/pickup[9287]: 8C10B42AD5: uid=106 from=<nagios>
Nov  4 00:07:15 nagios-2015 postfix/cleanup[22208]: 8C10B42AD5: message-id=<20151104000715.8C10B42AD5@ip-10-0-10-149>
Nov  4 00:07:15 nagios-2015 postfix/qmgr[31700]: 8C10B42AD5: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Nov  4 00:07:15 nagios-2015 postfix/local[22210]: 8C10B42AD5: 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=se
nt (delivered to mailbox)
Nov  4 00:07:15 nagios-2015 postfix/qmgr[31700]: 8C10B42AD5: removed
Nov  4 00:09:01 nagios-2015 postfix/pickup[9287]: 8551D42AD5: uid=0 from=<root>
Nov  4 00:09:01 nagios-2015 postfix/cleanup[23359]: 8551D42AD5: message-id=<20151104000901.8551D42AD5@ip-10-0-10-149>
Nov  4 00:09:01 nagios-2015 postfix/qmgr[31700]: 8551D42AD5: from=<root@ip-10-0-10-149>, size=771, nrcpt=1 (queue active)
Nov  4 00:09:01 nagios-2015 postfix/local[23361]: 8551D42AD5: 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=se
nt (delivered to mailbox)
Nov  4 00:09:01 nagios-2015 postfix/qmgr[31700]: 8551D42AD5: removed
Nov  4 00:12:15 nagios-2015 postfix/pickup[9287]: 8830A42AD5: uid=106 from=<nagios>
Nov  4 00:12:15 nagios-2015 postfix/cleanup[25636]: 8830A42AD5: message-id=<20151104001215.8830A42AD5@ip-10-0-10-149>
Nov  4 00:12:15 nagios-2015 postfix/qmgr[31700]: 8830A42AD5: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Nov  4 00:12:15 nagios-2015 postfix/local[25638]: 8830A42AD5: 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=se
nt (delivered to mailbox)
Nov  4 00:12:15 nagios-2015 postfix/qmgr[31700]: 8830A42AD5: removed
Nov  4 00:17:15 nagios-2015 postfix/pickup[9287]: 83F4442AD5: uid=106 from=<nagios>
Nov  4 00:17:15 nagios-2015 postfix/cleanup[28930]: 83F4442AD5: message-id=<20151104001715.83F4442AD5@ip-10-0-10-149>
Nov  4 00:17:15 nagios-2015 postfix/qmgr[31700]: 83F4442AD5: from=<nagios@ip-10-0-10-149>, size=492, nrcpt=1 (queue active)
Nov  4 00:17:15 nagios-2015 postfix/local[28932]: 83F4442AD5: 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=se
nt (delivered to mailbox)


Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 11:57 am
by hsmith
What's the hostname of this machine? The hostname command should tell you this.

Is this server on the web, or just internal?

We're going to need to make some changes to main.cf, but I want to get this information first so we can figure out what changes to make.

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 12:00 pm
by hsmith
We're looking for the email header here.

No need for the mail log at this point.

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 12:05 pm
by sinkak
actual hostname is nagios-2015.
but on main.cf it has old name ip-10-0-10-149.
i changed it to new name and restatred postfix

Code: Select all

Nov  4 16:42:12 nagios-2015 postfix/qmgr[6812]: DD22A42AC8: removed
Nov  4 16:47:12 nagios-2015 postfix/pickup[6811]: DA03742AC8: uid=106 from=<nagios>
Nov  4 16:47:12 nagios-2015 postfix/cleanup[22853]: DA03742AC8: message-id=<20151104164712.DA03742AC8@nagios-2015>
Nov  4 16:47:12 nagios-2015 postfix/qmgr[6812]: DA03742AC8: from=<nagios@nagios-2015>, size=480, nrcpt=1 (queue active)
Nov  4 16:47:12 nagios-2015 postfix/local[22856]: DA03742AC8: to=<root@nagios-2015>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 16:47:12 nagios-2015 postfix/qmgr[6812]: DA03742AC8: removed
Nov  4 16:52:12 nagios-2015 postfix/pickup[6811]: C631942AC8: uid=106 from=<nagios>
Nov  4 16:52:12 nagios-2015 postfix/cleanup[26326]: C631942AC8: message-id=<20151104165212.C631942AC8@nagios-2015>
Nov  4 16:52:12 nagios-2015 postfix/qmgr[6812]: C631942AC8: from=<nagios@nagios-2015>, size=480, nrcpt=1 (queue active)
Nov  4 16:52:12 nagios-2015 postfix/local[26328]: C631942AC8: to=<root@nagios-2015>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 16:52:12 nagios-2015 postfix/qmgr[6812]: C631942AC8: removed
Nov  4 16:57:12 nagios-2015 postfix/pickup[6811]: C339942AC8: uid=106 from=<nagios>
Nov  4 16:57:12 nagios-2015 postfix/cleanup[29737]: C339942AC8: message-id=<20151104165712.C339942AC8@nagios-2015>
Nov  4 16:57:12 nagios-2015 postfix/qmgr[6812]: C339942AC8: from=<nagios@nagios-2015>, size=480, nrcpt=1 (queue active)
Nov  4 16:57:12 nagios-2015 postfix/local[29739]: C339942AC8: to=<root@nagios-2015>, orig_to=<root>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 16:57:12 nagios-2015 postfix/qmgr[6812]: C339942AC8: removed
Nov  4 17:02:12 nagios-2015 postfix/pickup[6811]: F0A3642AC8: uid=106 from=<nagios>
Nov  4 17:02:13 nagios-2015 postfix/cleanup[892]: F0A3642AC8: message-id=<20151104170212.F0A3642AC8@nagios-2015>
Nov  4 17:02:13 nagios-2015 postfix/qmgr[6812]: F0A3642AC8: from=<nagios@nagios-2015>, size=480, nrcpt=1 (queue active)
Nov  4 17:02:13 nagios-2015 postfix/local[894]: F0A3642AC8: to=<root@nagios-2015>, orig_to=<root>, relay=local, delay=0.15, delays=0.09/0.03/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
Nov  4 17:02:13 nagios-2015 postfix/qmgr[6812]: F0A3642AC8: removed

Re: contacts.cfg is not working properly

Posted: Wed Nov 04, 2015 12:08 pm
by hsmith
Did that fix anything?

If not - still looking for those headers.