1.zabbix服务器上已安装postfix邮件服务,如果没安装用yum安装sendmail也可以(简单)

2.vim /etc/mail.rc 在此配置中加上用户名及密码等,即可用这个账号发送邮件

  set from=zabbix@xxx.com smtp=smtp.exmail.qq.com
  set smtp-auth-user=zabbix@xxx.com smtp-auth-password=xxxxxx
  set smtp-auth=login

3.进到zabbix调用脚本路径/usr/local/zabbix/share/zabbix/alertscripts,写一个配置发送邮件脚本,第二种方式为解决编码问题,要不收到的内容为一个附件

注意:1.txt 要不zabbix属组,属主,上级目录也是

  #发送邮件
  #`/bin/echo "$3" | /bin/mail -s "$2" $1`

  /bin/su - zabbix
  echo "$3" > /usr/local/zabbix/share/zabbix/alertscripts/1.txt
  /usr/bin/dos2unix /usr/local/zabbix/share/zabbix/alertscripts/1.txt
  mail -s "$2" $1 < /usr/local/zabbix/share/zabbix/alertscripts/1.txt

4.在zabbix上调用这个脚本即可

zabbix发送邮件的更多相关文章

  1. 使用zabbix发送邮件的简易设置流程(存档用)

    1.安装邮件软件 (一般默认安装sendmail,这样apache也不用重新设置.) $sudo yum install sendmail 2.在zabbix上设置发送邮件用的本地邮箱 选择管理-&g ...

  2. zabbix 发送邮件到企业微信

    #!/usr/bin/python2.7#_*_coding:utf-8 _*_#auther:拿来用用import requests,sys,jsonimport urllib3urllib3.di ...

  3. zabbix 发送邮件配置

    Administration->Users->User name->Media <img src="http://img.blog.csdn.net/20160919 ...

  4. zabbix发送邮件脚本

    #!/usr/bin/env python #-*- coding: UTF- -*- import os,sys reload(sys) sys.setdefaultencoding('utf8') ...

  5. Zabbix使用外部邮箱服务器发送邮件报警

    本来是想自己写一篇文章的,但是看到发现网上有写的不错的,于是乎又抄别人的文章,作为记录. 使用外部邮箱来发生邮件明显好处就是防止其他邮箱服务器当垃圾邮件处理,另一方面能降低收邮件延迟. 下面开始进行使 ...

  6. zabbix 配置外部邮件server发送邮件报警

    一.安装配置msmtp 1.下载msmtp wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2?big_mirror=0 ...

  7. 【zabbix系列】报警系统的设置和排除

    关于邮件报警,有非常多方案,这里选择的是稳定性较好.使用较多的msmtp+mutt方案. 该方案有一个非常好的地方在于不用自己来搭建独立的mailserver,能够使用第三方mail.这样的方法不仅能 ...

  8. Zabbix配置邮件监控

    zabbix服务端配置 安装软件并配置 使用第三方邮件实现报警 1. 安装软件 $ yum -y install mailx 2. 配置发送邮件账号密码和服务器 $ vim /etc/mail.rc ...

  9. zabbix实现自定义监控

    实现自定义监控项实例 .创建主机组 .创建主机 .创建监控项 .到需要监控的主机的agent中添加自定义的监控项目 cd /etc/zabbix/zabbix_agentd.d vi userpara ...

随机推荐

  1. 异常:The JSP specification requires that an attribute name is preceded by whitespace

    The JSP specification requires that an attribute name is preceded by whitespace: 其实这句话翻译就是 属性后面要必须有空 ...

  2. nginx的location

    nginx的location分为普通location和正则location. 在普通location中,匹配规则是最大前缀匹配. 在正则location中,匹配规则是先到先得匹配.(最先匹配的正则lo ...

  3. The given 'driver' ] is unknown, Doctrine currently supports only the follo wing drivers: pdo_mysql, pdo_sqlite, pdo_pgsql, pdo_oci, oci8, ibm_db2, pdo

    [Doctrine\DBAL\DBALException]                                                  The given 'driver' ] ...

  4. 3.09课·········for循环

    for循环:反复执行某段代码.for循环四要素:初始条件,循环条件,循环体,状态改变.for(初始条件;循环条件;状态改变){ 循环体} 若初始条件满足循环条件,则进入循环体,执行完循环体,跳回到状态 ...

  5. 2014暑假ACM13级一批集训内容

    2014 这个暑假,我大一的暑假来吧!!! 2014暑假ACM13级一批集训内容 集训期间时间安排: 周一到周六 上午:8:00-11:30 下午:2:00-5:30 晚上7:00-9:30 周日自由 ...

  6. how to close the old Session - if the same username starts a new Session?

    Question: want to close the old Session - if the same username starts a new Session Any ideas how i ...

  7. MS-SQL charindex的用法

    select * from table_a where charindex('a',id)>0 or charindex('b',id)>0 table_a 表中 id字段中含有" ...

  8. LinkedBlockingQueue,ArrayListBlockingQueue,SynchronousQueue

    LinkedBlockingQueue :1.读写锁分开,性能较 ArrayListBlockingQueue 只有一把锁控制读写要高一些.2.无界队列,不会触发Reject异常,ArrayListB ...

  9. bzoj 2005: [Noi2010]能量采集 筛法||欧拉||莫比乌斯

    2005: [Noi2010]能量采集 Time Limit: 10 Sec  Memory Limit: 552 MB[Submit][Status][Discuss] Description 栋栋 ...

  10. Array对象(一)

    Array是JavaScript中的一个事先定义好的对象(也可以称作一个类),可以直接使用. 创建Array对象: var array = new Array(); 创建指定元素个数的Array对象: ...