Send alert email settings using an external email account
One, close sendmail or postfix
1 service SendMail Stop #关闭 2 chkconfig sendmail off #禁止开机启动 3 service Postfix Stop 4 chkconfig postfix off
Note: When using an external mailbox account, you do not need to start sendmail or postfix if you send an alert message using an external mailbox while sendmail or Postfix is started, the external mailbox configuration information is read first. Second, install the Mail sending tool MAILX 1 yum install mailx #安装CentOS 5.x compiled installation MAILX, the MAILX version of the direct Yum installation is too old, there will be a problem using external mail delivery. Yum Remove Mailx #卸载系统自带的旧版mailx下载mailx:
1 http://nchc.dl.sourceforge.net/project/heirloom/heirloom-mailx/12.4/mailx-12.4.tar.bz2 2 tar jxvf mailx-12.4. tar.bz2 #解压 3 cd mailx-12.4 #进入目录 4 Make #编译
1 make install ucbinstall=/usr/bin/install #安装 2 ln-s/usr/local/bin/mailx/bin/ Mail #创建mailx到mail的软连接 3 ln-s/etc/nail.rc/etc/mail.rc #创建mailx配置文件软连接 4 Whereis Mailx #查看安装路径
Mailx-v #查看版本信息
Third, configure Zabbix service side external mailbox
Vi/etc/mail.rc #编辑, add the following information
1 Set from [Email protected] 126. com smtp=smtp. 126 . com 2 Set [Email protected] 126. com smtp-auth-password=password3set smtp-auth=login
: wq! #保存退出
echo "Zabbix test Mail" |mail-s "Zabbix" [email protected]
#测试发送邮件, title Zabbix, message content: Zabbix test mail, sent to the mailbox: [email protected] #这时候, email [email protected] will receive from [email protected] test mail Four , configure Zabbix server mail alarm 1, open Zabbix Management-warning media type-Create media type
Zabbix Mail Alarm Configuration