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.
hr7
Posts: 2 Joined: Sat Apr 08, 2017 10:34 am
Post
by hr7 » Sat Apr 08, 2017 10:50 am
HI, I've been trying to send an email notification to gmail or even other email address but it won't send. The web interface has shown that it has send the email. I take a look at the postfix mail log and below are the error. I'm using CentOs 7 and Nagios 4.3.1
Code: Select all
Apr 8 23:36:52 localhost postfix/pickup[19717]: 822B86642A0: uid=1001 from=<nagios>
Apr 8 23:36:52 localhost postfix/cleanup[20014]: 822B86642A0: message-id=<[email protected] >
Apr 8 23:36:52 localhost postfix/qmgr[19718]: 822B86642A0: from=<[email protected] >, size=736, nrcpt=1 (queue active)
Apr 8 23:36:52 localhost postfix/error[20016]: 822B86642A0: to=<[email protected] >, relay=none, delay=0.06, delays=0.04/0.01/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[74.125.30.26]:25: Connection timed out)
and here are the postfix configuration.
Code: Select all
myhostname = localhost.localdomain
mydomain = localdomain
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost, $mydomain
mynetworks = 127.0.0.0/8, 192.168.1.0/24
relay_domains = $mydestination
my mail path and command.cfg lines.
Code: Select all
/usr/bin/mail
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Please point out my mistake. I've been trying to send an email for 3 days. Your help is highly appreciated.
avandemore
Posts: 1597 Joined: Tue Sep 27, 2016 4:57 pm
Post
by avandemore » Mon Apr 10, 2017 11:12 am
This is the issue:
Code: Select all
(delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[74.125.30.26]:25: Connection timed out)
From my terminal:
Code: Select all
# telnet 74.125.30.26 25
Trying 74.125.30.26...
Connected to 74.125.30.26.
Escape character is '^]'.
220 mx.google.com ESMTP g10si1087889otc.146 - gsmtp
So there is some type of networking issue afoot.
Previous Nagios employee
hr7
Posts: 2 Joined: Sat Apr 08, 2017 10:34 am
Post
by hr7 » Tue Apr 11, 2017 7:58 pm
avandemore wrote: This is the issue:
Code: Select all
(delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[74.125.30.26]:25: Connection timed out)
From my terminal:
Code: Select all
# telnet 74.125.30.26 25
Trying 74.125.30.26...
Connected to 74.125.30.26.
Escape character is '^]'.
220 mx.google.com ESMTP g10si1087889otc.146 - gsmtp
So there is some type of networking issue afoot.
Is it because of the firewall? how do I fix it? I already put my network on main.cf file but it's not working.
dwhitfield
Former Nagios Staff
Posts: 4583 Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:
Post
by dwhitfield » Tue Apr 11, 2017 8:39 pm
This is not really a Nagios question, but if you post the output of traceroute 74.125.30.26 , it may be obvious. You may have to install traceroute first. yum install traceroute in your case