To NetEase mailbox as an example, using the ZABBIX through the server to send ma

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

ZABBIX through the msmtp+ server to send mail mutt calls; third party mail

ZABBIX how to deploy here is not introduced. You can search the ZABBIX in my blog

One. The need to use the msmtp tar package, then start the download and configure msmtp

# yum -y install mutt

# cd /tmp/src
# wget http://garr.dl.sourceforge.net/project/msmtp/msmtp/1.4.31/msmtp-1.4.31.tar.bz2
# tar xf msmtp-1.4.31.tar.bz2
# cd msmtp-1.4.31
# ./configure --prefix=/usr/local/msmtp
# make && make install
# mkdir -p /usr/local/msmtp/etc
# vim /usr/local/msmtp/etc/msmtprc
### Add the following content:
defaults

account zabbix

host mail.163.com

from

auth login

port 25

tls off

user

password 123

account default:zabbix

logfile /usr/local/msmtp/log/msmtp.log

# vim /root/.msmtprc

host mail.163.com

tls off

auth login

from

user zabbix

password 123

# vim /root/.muttrc

setsendmail="/usr/local/msmtp/bin/msmtp"

set use_from=yes

set from=

set envelope_from=yes

# mkdir -p /usr/local/msmtp/log

# touch /usr/local/msmtp/log/msmtp.log

#

# vim /etc/Muttrc

Amended as:

setsendmail="/usr/local/msmtp/bin/msmtp"

set use_from=yes

set realname=

set editor="vi"

set copy=no

Test:

# This is receiving a test mail e-mail you can set to own and others such as QQ mailbox to accept test mail for you.

echo "Email" |mutt -s"test"

Configuration of ZABBIX server two.

The AlertScriptsPath=${datadir}/zabbix/alertscripts annotation to cancel, prepared this Email script.

# vim/usr/local/zabbix/share/zabbix/alertscripts/sendmail.sh
#####Enter the following contents:
#!/bin/bash

# $1 sendmail address

# $2 sendmail subject

# $3 file

echo "$3" | mutt -s"$2" $1

Add execute permissions:

# chmod +x /usr/local/zabbix/share/zabbix/alertscripts/sendmail.sh

Configure the ZABBIX web interface:

The above picture in the two note:

1 Type to select Script

2 Script name here need to call out the name of the script, save it

]

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Wendy at December 23, 2013 - 2:59 PM