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=<20170408153652.822B86642A0@localhost.localdomain>
Apr 8 23:36:52 localhost postfix/qmgr[19718]: 822B86642A0: from=<nagios@localdomain.localdomain>, size=736, nrcpt=1 (queue active)
Apr 8 23:36:52 localhost postfix/error[20016]: 822B86642A0: to=<example@gmail.com>, 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)
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
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$
}