ZABBIX之邮件报警
Posted Tank
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ZABBIX之邮件报警相关的知识,希望对你有一定的参考价值。
1,安装msmtp
wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2
tar jxvf msmtp-1.4.30.tar.bz2
./configure --prefix=/usr/local/msmtp
make
make install
2,msmtprc配置
mkdir /usr/local/msmtp/etc
cat /usr/local/msmtp/etc/msmtprc
defaults
account zabbix
host smtp.exmail.qq.com
from [email protected]
user [email protected]
password 123456
port 25
auth login
tls off
logfile /tmp/msmtp.log
account default: zabbix
chmod 600 /usr/local/msmtp/etc/msmtprc
3,测试
/usr/local/msmtp/bin/msmtp [email protected]
输入内容
按ctrl+D发出
按ctrl+D发出
4, 安装mutt
yum install mutt*
cat /etc/Muttrc
set from="[email protected]"
set sendmail="/usr/local/msmtp/bin/msmtp"
set use_from=yes
set realname="[email protected]"
set copy=no
set editor="vim"
set send_charset="UTF-8"
测试一下:echo "邮件报警测试" | mutt -s "测试" [email protected]
5, 报警脚本
vim /usr/bin/baojing.sh
#!/bin/bash
echo "$3" | mutt -s "$2" $1
$1收件人 $2主题 $3邮件正文
以上是关于ZABBIX之邮件报警的主要内容,如果未能解决你的问题,请参考以下文章